From 9a74958b22f2ae5566415cf131a76f450a3f6139 Mon Sep 17 00:00:00 2001 From: Rupa Schomaker Date: Mon, 19 Apr 2010 14:42:11 -0500 Subject: [PATCH] nibblebill - free properly if using custom_sql --- src/mod/applications/mod_nibblebill/mod_nibblebill.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_nibblebill/mod_nibblebill.c b/src/mod/applications/mod_nibblebill/mod_nibblebill.c index fe9a9ecf3e..093fbd4ef2 100755 --- a/src/mod/applications/mod_nibblebill/mod_nibblebill.c +++ b/src/mod/applications/mod_nibblebill/mod_nibblebill.c @@ -337,9 +337,10 @@ static switch_status_t bill_event(float billamount, const char *billaccount, swi switch_odbc_statement_handle_free(&stmt); 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_stream.data); return SWITCH_STATUS_SUCCESS; } @@ -385,9 +386,10 @@ static float get_balance(const char *billaccount, switch_channel_t *channel) } 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_stream.data); return balance; }