Skip to content

Commit

Permalink
acc: cdr - do not free static empty string in case of error
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Mar 4, 2024
1 parent 6ee26a3 commit 0fc0cdd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/acc/acc_cdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ int cdr_core2strar(struct dlg_cell *dlg, str *values, int *unused, char *types)
/* cleanup already allocated memory and
* return that we didn't do anything */
for(i = i - 1; i >= 0; i--) {
if(NULL != values[i].s) {
if(NULL != values[i].s && types[i] != TYPE_NULL) {
pkg_free(values[i].s);
values[i].s = NULL;
}
values[i].s = NULL;
}
return 0;
}
Expand Down

0 comments on commit 0fc0cdd

Please sign in to comment.