mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Fix missing/incomplete NULL checks in multiple source files (#104564)
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
This commit is contained in:
parent
ae00b810d1
commit
13b5d79090
5 changed files with 20 additions and 1 deletions
|
@ -2381,7 +2381,12 @@ get_local_timestamp(PyObject *dt, int64_t *local_ts)
|
|||
/////
|
||||
// Functions for cache handling
|
||||
|
||||
/* Constructor for StrongCacheNode */
|
||||
/* Constructor for StrongCacheNode
|
||||
*
|
||||
* This function doesn't set MemoryError if PyMem_Malloc fails,
|
||||
* as the cache intentionally doesn't propagate exceptions
|
||||
* and fails silently if error occurs.
|
||||
*/
|
||||
static StrongCacheNode *
|
||||
strong_cache_node_new(PyObject *key, PyObject *zone)
|
||||
{
|
||||
|
@ -2572,6 +2577,9 @@ update_strong_cache(zoneinfo_state *state, const PyTypeObject *const type,
|
|||
}
|
||||
|
||||
StrongCacheNode *new_node = strong_cache_node_new(key, zone);
|
||||
if (new_node == NULL) {
|
||||
return;
|
||||
}
|
||||
StrongCacheNode **root = &(state->ZONEINFO_STRONG_CACHE);
|
||||
move_strong_cache_node_to_front(state, root, new_node);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue