]> granicus.if.org Git - python/commitdiff
Fix reference leak in _pickle.
authorAlexandre Vassalotti <alexandre@peadrop.com>
Sun, 21 Apr 2013 04:28:21 +0000 (21:28 -0700)
committerAlexandre Vassalotti <alexandre@peadrop.com>
Sun, 21 Apr 2013 04:28:21 +0000 (21:28 -0700)
Modules/_pickle.c

index 5564803b88ff8b83c4d248e519f49839be2acbaa..a8d6684b7cdbc8bf056e6ff5c8eb203a58248bdc 100644 (file)
@@ -5039,11 +5039,13 @@ do_append(UnpicklerObject *self, Py_ssize_t x)
             if (result == NULL) {
                 Pdata_clear(self->stack, i + 1);
                 Py_SIZE(self->stack) = x;
+                Py_DECREF(append_func);
                 return -1;
             }
             Py_DECREF(result);
         }
         Py_SIZE(self->stack) = x;
+        Py_DECREF(append_func);
     }
 
     return 0;