diff --git a/mercurial/cext/bdiff.c b/mercurial/cext/bdiff.c --- a/mercurial/cext/bdiff.c +++ b/mercurial/cext/bdiff.c @@ -155,12 +155,8 @@ cleanup: PyEval_RestoreThread(_save); PyBuffer_Release(&ba); PyBuffer_Release(&bb); - if (al) { - free(al); - } - if (bl) { - free(bl); - } + free(al); + free(bl); if (l.next) { bdiff_freehunks(l.next); } diff --git a/mercurial/cext/manifest.c b/mercurial/cext/manifest.c --- a/mercurial/cext/manifest.c +++ b/mercurial/cext/manifest.c @@ -190,10 +190,8 @@ static void lazymanifest_dealloc(lazyman free(self->lines[i].start); } } - if (self->lines) { - free(self->lines); - self->lines = NULL; - } + free(self->lines); + self->lines = NULL; if (self->pydata) { Py_DECREF(self->pydata); self->pydata = NULL; diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c --- a/mercurial/cext/revlog.c +++ b/mercurial/cext/revlog.c @@ -319,10 +319,8 @@ static void _index_clearcaches(indexObje PyMem_Free(self->offsets); self->offsets = NULL; } - if (self->nt) { - free(self->nt); - self->nt = NULL; - } + free(self->nt); + self->nt = NULL; Py_CLEAR(self->headrevs); }