[PATCH 2 of 2] dirstate: fix leak of entry object in dirstate_item_from_v1_data()

Yuya Nishihara yuya at tcha.org
Thu Sep 23 08:27:34 UTC 2021


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1632383555 -32400
#      Thu Sep 23 16:52:35 2021 +0900
# Node ID bc82b526a41b47adfe8c49639b0664bcaa4b26b8
# Parent  13efd8fdc55fe3ed8ab195fff0c52a249d4dcc73
dirstate: fix leak of entry object in dirstate_item_from_v1_data()

diff --git a/mercurial/cext/parsers.c b/mercurial/cext/parsers.c
--- a/mercurial/cext/parsers.c
+++ b/mercurial/cext/parsers.c
@@ -352,6 +352,7 @@ dirstate_item_from_v1_data(char state, i
 		PyErr_Format(PyExc_RuntimeError,
 		             "unknown state: `%c` (%d, %d, %d)", state, mode,
 		             size, mtime, NULL);
+		Py_DECREF(t);
 		return NULL;
 	}
 




More information about the Mercurial-devel mailing list