summaryrefslogtreecommitdiffstats
path: root/Modules/cPickle.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-08-02 04:27:11 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-08-02 04:27:11 (GMT)
commit99dfe3c411bdaa835075a27fdccefef13d88e214 (patch)
tree0f7797f5275520980f3a022b9b19828f4760d030 /Modules/cPickle.c
parent62decc9f4966c060a3d4bcf762d8940d666496c5 (diff)
downloadcpython-99dfe3c411bdaa835075a27fdccefef13d88e214.zip
cpython-99dfe3c411bdaa835075a27fdccefef13d88e214.tar.gz
cpython-99dfe3c411bdaa835075a27fdccefef13d88e214.tar.bz2
Prevent memory leak on error.
Reported by Klocwork #36
Diffstat (limited to 'Modules/cPickle.c')
-rw-r--r--Modules/cPickle.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/cPickle.c b/Modules/cPickle.c
index 9d979de..24c98cc 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: