diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2003-02-10 03:10:43 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2003-02-10 03:10:43 (GMT) |
commit | 4adc9abc32a26f5ce5e2dada33d019f31170b5be (patch) | |
tree | 05932b4ee966256fc528a68b7d560723386db513 /Modules | |
parent | de8b94c3e1154eb7778a6d5729129b6a57c365fb (diff) | |
download | cpython-4adc9abc32a26f5ce5e2dada33d019f31170b5be.zip cpython-4adc9abc32a26f5ce5e2dada33d019f31170b5be.tar.gz cpython-4adc9abc32a26f5ce5e2dada33d019f31170b5be.tar.bz2 |
Fix memory leak of newstr when putenv() fails
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/posixmodule.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 2da5d41..9dea4b5 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -5662,6 +5662,7 @@ posix_putenv(PyObject *self, PyObject *args) new = PyString_AS_STRING(newstr); PyOS_snprintf(new, len, "%s=%s", s1, s2); if (putenv(new)) { + Py_DECREF(newstr); posix_error(); return NULL; } |