diff Objects/bytesobject.c @ 86720:549cd815bf8d

Issue #18408: Fix error handling in PyBytes_FromObject() _PyBytes_Resize(&new) sets new to NULL on error, don't call Py_DECREF() with NULL.
author Victor Stinner <victor.stinner@gmail.com>
date Tue, 29 Oct 2013 03:14:22 +0100
parents 3055e61f1e66
children 536a7c09c7fd
line wrap: on
line diff
--- a/Objects/bytesobject.c	Tue Oct 29 02:23:46 2013 +0100
+++ b/Objects/bytesobject.c	Tue Oct 29 03:14:22 2013 +0100
@@ -2660,9 +2660,8 @@
     return new;
 
   error:
-    /* Error handling when new != NULL */
     Py_XDECREF(it);
-    Py_DECREF(new);
+    Py_XDECREF(new);
     return NULL;
 }