Patchwork D4152: index: use PyMem_Free() to free nodeetree instance

login
register
mail settings
Submitter phabricator
Date Aug. 7, 2018, 12:52 p.m.
Message ID <c1bd93956e24924e2ee72f00afa18739@localhost.localdomain>
Download mbox | patch
Permalink /patch/33391/
State Not Applicable
Headers show

Comments

phabricator - Aug. 7, 2018, 12:52 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG05c1f5f49ebb: index: use PyMem_Free() to free nodeetree instance (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4152?vs=10033&id=10047

REVISION DETAIL
  https://phab.mercurial-scm.org/D4152

AFFECTED FILES
  mercurial/cext/revlog.c

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c
--- a/mercurial/cext/revlog.c
+++ b/mercurial/cext/revlog.c
@@ -323,7 +323,7 @@ 
 	}
 	if (self->nt != NULL) {
 		free(self->nt->nodes);
-		free(self->nt);
+		PyMem_Free(self->nt);
 	}
 	self->nt = NULL;
 	Py_CLEAR(self->headrevs);
@@ -1106,7 +1106,7 @@ 
 
 		self->nt->nodes = calloc(self->nt->capacity, sizeof(nodetreenode));
 		if (self->nt->nodes == NULL) {
-			free(self->nt);
+			PyMem_Free(self->nt);
 			self->nt = NULL;
 			PyErr_NoMemory();
 			return -1;
@@ -1119,7 +1119,7 @@ 
 		self->nt->length = 1;
 		if (nt_insert(self, nullid, -1) == -1) {
 			free(self->nt->nodes);
-			free(self->nt);
+			PyMem_Free(self->nt);
 			self->nt = NULL;
 			return -1;
 		}