summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2003-02-10 03:10:43 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2003-02-10 03:10:43 (GMT)
commit4adc9abc32a26f5ce5e2dada33d019f31170b5be (patch)
tree05932b4ee966256fc528a68b7d560723386db513 /Modules
parentde8b94c3e1154eb7778a6d5729129b6a57c365fb (diff)
downloadcpython-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.c1
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;
}