mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
[Backport r51033 | neal.norwitz]
Prevent memory leak on error. Reported by Klocwork #36
This commit is contained in:
@@ -3394,11 +3394,11 @@ load_string(Unpicklerobject *self)
|
||||
/********************************************/
|
||||
|
||||
str = PyString_DecodeEscape(p, len, NULL, 0, NULL);
|
||||
free(s);
|
||||
if (str) {
|
||||
PDATA_PUSH(self->stack, str, -1);
|
||||
res = 0;
|
||||
}
|
||||
free(s);
|
||||
return res;
|
||||
|
||||
insecure:
|
||||
|
||||
Reference in New Issue
Block a user