# HG changeset patch # User Yuya Nishihara # Date 1536151613 -32400 # Node ID ca77788c81bc449a6ebd47f80d1a50a3813002b4 # Parent adacefb0b7ea4abbb802edbf9f83e89f68998f8b manifest: incref/decref copy->pydata to clarify 'copy' holds a reference diff --git a/mercurial/cext/manifest.c b/mercurial/cext/manifest.c --- a/mercurial/cext/manifest.c +++ b/mercurial/cext/manifest.c @@ -725,7 +725,7 @@ copy->maxlines = self->maxlines; copy->numlines = 0; copy->pydata = self->pydata; - Py_INCREF(self->pydata); + Py_INCREF(copy->pydata); for (i = 0; i < self->numlines; i++) { PyObject *arglist = NULL, *result = NULL; arglist = Py_BuildValue(PY23("(s)", "(y)"), @@ -739,7 +739,7 @@ * through and give up */ if (!result) { free(copy->lines); - Py_DECREF(self->pydata); + Py_DECREF(copy->pydata); return NULL; } if (PyObject_IsTrue(result)) {