changeset 31478:a43fd9ec2a39

parsers: use Python memory allocator in commonancestorsheads()
author Gregory Szorc <gregory.szorc@gmail.com>
date Thu, 09 Mar 2017 12:02:59 -0800
parents b9dd03ed564f
children bc445c556d3c
files mercurial/parsers.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/parsers.c	Thu Mar 09 11:56:47 2017 -0800
+++ b/mercurial/parsers.c	Thu Mar 09 12:02:59 2017 -0800
@@ -2166,7 +2166,7 @@
 	int *revs;
 
 	argcount = PySequence_Length(args);
-	revs = malloc(argcount * sizeof(*revs));
+	revs = PyMem_Malloc(argcount * sizeof(*revs));
 	if (argcount > 0 && revs == NULL)
 		return PyErr_NoMemory();
 	len = index_length(self) - 1;
@@ -2237,11 +2237,11 @@
 		goto bail;
 
 done:
-	free(revs);
+	PyMem_Free(revs);
 	return ret;
 
 bail:
-	free(revs);
+	PyMem_Free(revs);
 	Py_XDECREF(ret);
 	return NULL;
 }