if (!myrpt->p.statpost_url) return;
str = ast_malloc(strlen(pairs) + strlen(myrpt->p.statpost_url) + 200);
astr = ast_strdup(myrpt->p.statpost_program);
- if ((!str) || (!astr)) return;
+ if ((!str) || (!astr)) {
+ ast_free(str);
+ ast_free(astr);
+ return;
+ }
n = finddelim(astr,astrs,100);
if (n < 1) return;
ast_mutex_lock(&myrpt->statpost_lock);
for(j = 0; j < numoflinks; j++){ /* ast_free() all link names */
ast_free(listoflinks[j]);
}
- if(called_number){
- ast_free(called_number);
- }
- if(lastdtmfcommand){
- ast_free(lastdtmfcommand);
- }
+ ast_free(called_number);
+ ast_free(lastdtmfcommand);
return RESULT_SUCCESS;
}
}
if(res)
break;
}
- if(p)
- ast_free(p);
+ ast_free(p);
if(!res)
res = play_tone_pair(chan, 0, 0, 100, 0); /* This is needed to ensure the last tone segment is timed correctly */
else{
res = -1;
}
- if(telemetry_save)
- ast_free(telemetry_save);
+ ast_free(telemetry_save);
return res;
}
interval = 0;
break;
}
- if(wait_times_save)
- ast_free(wait_times_save);
+ ast_free(wait_times_save);
return interval;
}
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);