##// END OF EJS Templates
cext: stop worrying and love the free(NULL)...
Josef 'Jeff' Sipek -
r38320:d9e87566 stable
parent child Browse files
Show More
@@ -155,12 +155,8 b' cleanup:'
155 PyEval_RestoreThread(_save);
155 PyEval_RestoreThread(_save);
156 PyBuffer_Release(&ba);
156 PyBuffer_Release(&ba);
157 PyBuffer_Release(&bb);
157 PyBuffer_Release(&bb);
158 if (al) {
158 free(al);
159 free(al);
159 free(bl);
160 }
161 if (bl) {
162 free(bl);
163 }
164 if (l.next) {
160 if (l.next) {
165 bdiff_freehunks(l.next);
161 bdiff_freehunks(l.next);
166 }
162 }
@@ -190,10 +190,8 b' static void lazymanifest_dealloc(lazyman'
190 free(self->lines[i].start);
190 free(self->lines[i].start);
191 }
191 }
192 }
192 }
193 if (self->lines) {
193 free(self->lines);
194 free(self->lines);
194 self->lines = NULL;
195 self->lines = NULL;
196 }
197 if (self->pydata) {
195 if (self->pydata) {
198 Py_DECREF(self->pydata);
196 Py_DECREF(self->pydata);
199 self->pydata = NULL;
197 self->pydata = NULL;
@@ -319,10 +319,8 b' static void _index_clearcaches(indexObje'
319 PyMem_Free(self->offsets);
319 PyMem_Free(self->offsets);
320 self->offsets = NULL;
320 self->offsets = NULL;
321 }
321 }
322 if (self->nt) {
322 free(self->nt);
323 free(self->nt);
323 self->nt = NULL;
324 self->nt = NULL;
325 }
326 Py_CLEAR(self->headrevs);
324 Py_CLEAR(self->headrevs);
327 }
325 }
328
326
General Comments 0
You need to be logged in to leave comments. Login now