]> granicus.if.org Git - python/commitdiff
Issue #18408: Oh, I was wrong: Pickler_New() must call Py_DECREF() to destroy
authorVictor Stinner <victor.stinner@gmail.com>
Thu, 11 Jul 2013 22:08:59 +0000 (00:08 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Thu, 11 Jul 2013 22:08:59 +0000 (00:08 +0200)
the newly created pickler, and not PyObject_GC_Del().

Modules/_pickle.c

index adb642e2f6248fdd7a13111159ad1c1c0330ff7d..8b3438e4e3721227b99dd52f4b3275d458a44cc1 100644 (file)
@@ -782,7 +782,7 @@ _Pickler_New(void)
                                                     self->max_output_len);
 
     if (self->memo == NULL || self->output_buffer == NULL) {
-        PyObject_GC_Del(self);
+        Py_DECREF(self);
         return NULL;
     }
     return self;