nibblebill - free properly if using custom_sql
This commit is contained in:
parent
ca9dfc3c5e
commit
9a74958b22
|
@ -337,9 +337,10 @@ static switch_status_t bill_event(float billamount, const char *billaccount, swi
|
||||||
switch_odbc_statement_handle_free(&stmt);
|
switch_odbc_statement_handle_free(&stmt);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if (sql != globals.custom_sql_save) {
|
if (sql != globals.custom_sql_lookup && sql != sql_stream.data) {
|
||||||
switch_safe_free(sql);
|
switch_safe_free(sql);
|
||||||
}
|
}
|
||||||
|
switch_safe_free(sql_stream.data);
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -385,9 +386,10 @@ static float get_balance(const char *billaccount, switch_channel_t *channel)
|
||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if (sql != globals.custom_sql_lookup) {
|
if (sql != globals.custom_sql_lookup && sql != sql_stream.data) {
|
||||||
switch_safe_free(sql);
|
switch_safe_free(sql);
|
||||||
}
|
}
|
||||||
|
switch_safe_free(sql_stream.data);
|
||||||
return balance;
|
return balance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue