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

login
register
mail settings
Submitter Yuya Nishihara
Date Sept. 23, 2021, 8:27 a.m.
Message ID <bc82b526a41b47adfe8c.1632385654@lemosa>
Download mbox | patch
Permalink /patch/49807/
State New
Headers show

Comments

Yuya Nishihara - Sept. 23, 2021, 8:27 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@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()

Patch

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;
 	}