mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
Eliminate several needless checks and fix a few memory leaks
(closes issue #14833) Reported by: contactmayankjain Patches: all_changes.patch uploaded by contactmayankjain (license 740) slightly modified by me git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@197616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -342,11 +342,11 @@ void *__ao2_alloc_debug(size_t data_size, ao2_destructor_fn destructor_fn, char
|
||||
void *obj;
|
||||
FILE *refo = ref_debug ? fopen(REF_FILE,"a") : NULL;
|
||||
|
||||
obj = internal_ao2_alloc(data_size, destructor_fn, file, line, funcname);
|
||||
|
||||
if (obj == NULL)
|
||||
if ((obj = internal_ao2_alloc(data_size, destructor_fn, file, line, funcname)) == NULL) {
|
||||
fclose(refo);
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
if (refo) {
|
||||
fprintf(refo, "%p =1 %s:%d:%s (%s)\n", obj, file, line, funcname, tag);
|
||||
fclose(refo);
|
||||
|
Reference in New Issue
Block a user