Mercurial > hg-stable
diff mercurial/parsers.c @ 31479:bc445c556d3c
parsers: use Python memory allocator for indexObject->offsets
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 09 Mar 2017 12:09:31 -0800 |
parents | a43fd9ec2a39 |
children | af3ef002395d |
line wrap: on
line diff
--- a/mercurial/parsers.c Thu Mar 09 12:02:59 2017 -0800 +++ b/mercurial/parsers.c Thu Mar 09 12:09:31 2017 -0800 @@ -817,8 +817,8 @@ { if (self->inlined && pos > 0) { if (self->offsets == NULL) { - self->offsets = malloc(self->raw_length * - sizeof(*self->offsets)); + self->offsets = PyMem_Malloc(self->raw_length * + sizeof(*self->offsets)); if (self->offsets == NULL) return (const char *)PyErr_NoMemory(); inline_scan(self, self->offsets); @@ -1031,7 +1031,7 @@ self->cache = NULL; } if (self->offsets) { - free(self->offsets); + PyMem_Free(self->offsets); self->offsets = NULL; } if (self->nt) {