[PATCH 1 of 3] osutil: don't leak on statfiles error

Bryan O'Sullivan bos at serpentine.com
Tue Nov 17 21:48:17 UTC 2015


# HG changeset patch
# User Bryan O'Sullivan <bos at serpentine.com>
# Date 1447796589 28800
#      Tue Nov 17 13:43:09 2015 -0800
# Node ID 2476cd3ef3f7314553f6d88ce3a4bcbe730780bb
# Parent  f9984f76fd90e439221425d751e29bae17bec995
osutil: don't leak on statfiles error

Found using the power of the mighty eyeball.

diff --git a/mercurial/osutil.c b/mercurial/osutil.c
--- a/mercurial/osutil.c
+++ b/mercurial/osutil.c
@@ -615,7 +615,7 @@ static PyObject *statfiles(PyObject *sel
 
 		pypath = PySequence_GetItem(names, i);
 		if (!pypath)
-			return NULL;
+			goto bail;
 		path = PyString_AsString(pypath);
 		if (path == NULL) {
 			Py_DECREF(pypath);


More information about the Mercurial-devel mailing list