pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/commit/6c56356109616ea1292aafa48d30536279ec0937

[3.9] bpo-41056: Fix a possible MemoryError leak within zoneinfo. (GH… · python/cpython@6c56356 · GitHub
Skip to content

Commit 6c56356

Browse files
pgansslegpshead
andauthored
[3.9] bpo-41056: Fix a possible MemoryError leak within zoneinfo. (GH-21007)
This was detected by our Coverity scan as a REVERSE_INULL issue. Automerge-Triggered-By: @gpshead (cherry picked from commit d780fa7) Co-authored-by: Gregory P. Smith <greg@krypto.org>
1 parent d518ed0 commit 6c56356

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed an instance where a MemoryError within the zoneinfo module might not be reported or not reported at its source. (found by Coverity)

Modules/_zoneinfo.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,11 @@ zoneinfo_new(PyTypeObject *type, PyObject *args, PyObject *kw)
278278

279279
instance =
280280
PyObject_CallMethod(weak_cache, "setdefault", "OO", key, tmp);
281-
((PyZoneInfo_ZoneInfo *)instance)->source = SOURCE_CACHE;
282-
283281
Py_DECREF(tmp);
284-
285282
if (instance == NULL) {
286283
return NULL;
287284
}
285+
((PyZoneInfo_ZoneInfo *)instance)->source = SOURCE_CACHE;
288286
}
289287

290288
update_strong_cache(type, key, instance);
@@ -1622,7 +1620,7 @@ parse_abbr(const char *const p, PyObject **abbr)
16221620
}
16231621

16241622
*abbr = PyUnicode_FromStringAndSize(str_start, str_end - str_start);
1625-
if (abbr == NULL) {
1623+
if (*abbr == NULL) {
16261624
return -1;
16271625
}
16281626

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy