]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[Backport r50781 | neal.norwitz]
authorAndrew M. Kuchling <amk@amk.ca>
Tue, 3 Oct 2006 18:55:06 +0000 (18:55 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Tue, 3 Oct 2006 18:55:06 +0000 (18:55 +0000)
Fix memory leaks spotted by Klocwork #37.

Modules/cPickle.c

index c672d1f2d7616820ae2aaf314d15bc8077d21b33..0b36e7ef03d6a80842f7da21796c8aa7e1904003 100644 (file)
@@ -2620,7 +2620,7 @@ Pickle_getvalue(Picklerobject *self, PyObject *args)
                        if (ik >= lm || ik == 0) {
                                PyErr_SetString(PicklingError,
                                                "Invalid get data");
-                               return NULL;
+                               goto err;
                        }
                        if (have_get[ik]) /* with matching get */
                                rsize += ik < 256 ? 2 : 5;
@@ -2632,7 +2632,7 @@ Pickle_getvalue(Picklerobject *self, PyObject *args)
                        ) {
                        PyErr_SetString(PicklingError,
                                        "Unexpected data in internal list");
-                       return NULL;
+                       goto err;
                }
 
                else { /* put */