nibblebill - free properly if using custom_sql

This commit is contained in:
Rupa Schomaker 2010-04-19 14:42:11 -05:00
parent ca9dfc3c5e
commit 9a74958b22
1 changed files with 4 additions and 2 deletions

View File

@ -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;
} }