From: Neal Norwitz Date: Wed, 2 Aug 2006 04:27:11 +0000 (+0000) Subject: Prevent memory leak on error. X-Git-Tag: v2.5b3~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=99dfe3c411bdaa835075a27fdccefef13d88e214;p=python Prevent memory leak on error. Reported by Klocwork #36 --- diff --git a/Modules/cPickle.c b/Modules/cPickle.c index 9d979def88..24c98ccb22 100644 --- a/Modules/cPickle.c +++ b/Modules/cPickle.c @@ -3401,11 +3401,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: