]> granicus.if.org Git - python/commitdiff
Fix a tiny and unlikely memory leak. Was there before too, and actually
authorTim Peters <tim.peters@gmail.com>
Sat, 5 May 2001 04:10:25 +0000 (04:10 +0000)
committerTim Peters <tim.peters@gmail.com>
Sat, 5 May 2001 04:10:25 +0000 (04:10 +0000)
several of these turned up and got fixed during the iteration crusade.

Objects/abstract.c

index 2fe6b1f8391d5369d5e84e7d7dd0899f73cd4e12..30e6191c6ab8bf323985e1a3ec0c7920226d658d 100644 (file)
@@ -1220,8 +1220,10 @@ PySequence_Tuple(PyObject *v)
                                n += 10;
                        else
                                n += 100;
-                       if (_PyTuple_Resize(&result, n, 0) != 0)
+                       if (_PyTuple_Resize(&result, n, 0) != 0) {
+                               Py_DECREF(item);
                                goto Fail;
+                       }
                }
                PyTuple_SET_ITEM(result, j, item);
        }