parsers: avoid leak of nonnset and otherpset
authorAugie Fackler <augie@google.com>
Fri, 10 Mar 2017 16:53:00 -0500
changeset 31291 fffd1abb1337
parent 31290 f819aa9dbbf9
child 31292 b6ab0adf379d
parsers: avoid leak of nonnset and otherpset Py_BuildValue increments the refcount, rather than stealing the reference, which I missed in code review.
mercurial/parsers.c
--- a/mercurial/parsers.c	Thu Mar 09 20:33:29 2017 -0800
+++ b/mercurial/parsers.c	Fri Mar 10 16:53:00 2017 -0500
@@ -604,6 +604,8 @@
 	result = Py_BuildValue("(OO)", nonnset, otherpset);
 	if (result == NULL)
 		goto bail;
+	Py_DECREF(nonnset);
+	Py_DECREF(otherpset);
 	return result;
 bail:
 	Py_XDECREF(nonnset);