Patchwork [stable] parsers.c: fix a couple of memory leaks

login
register
mail settings
Submitter Danek Duvall
Date June 11, 2014, 10:43 p.m.
Message ID <b091b262aa6d25e7e466.1402526588@smelly>
Download mbox | patch
Permalink /patch/4979/
State Superseded
Commit 8da100383dc32c1f12dcc3ce8dd4ea38c6281158
Headers show

Comments

Danek Duvall - June 11, 2014, 10:43 p.m.
# HG changeset patch
# User Danek Duvall <danek.duvall@oracle.com>
# Date 1402525864 25200
#      Wed Jun 11 15:31:04 2014 -0700
# Branch stable
# Node ID b091b262aa6d25e7e4663672daf2b6d8f127ab48
# Parent  b35f8c487e396487e89f98e92da57ac5eb9833af
parsers.c: fix a couple of memory leaks

Patch

diff --git a/mercurial/parsers.c b/mercurial/parsers.c
--- a/mercurial/parsers.c
+++ b/mercurial/parsers.c
@@ -1403,8 +1403,12 @@  static PyObject *find_deepest(indexObjec
 		final |= i;
 		j -= 1;
 	}
-	if (final == 0)
+	if (final == 0) {
+		free(depth);
+		free(seen);
+		free(interesting);
 		return PyList_New(0);
+	}
 
 	dict = PyDict_New();
 	if (dict == NULL)