Revision
17338
Author
rupa
Date
2010-04-19 14:42:41 -0500 (Mon, 19 Apr 2010)

Log Message

nibblebill - free properly if using custom_sql

Modified Paths

Property Changed

Diff

Modified: freeswitch/trunk/src/mod/applications/mod_nibblebill/mod_nibblebill.c (17337 => 17338)


--- freeswitch/trunk/src/mod/applications/mod_nibblebill/mod_nibblebill.c	2010-04-19 18:18:20 UTC (rev 17337)
+++ freeswitch/trunk/src/mod/applications/mod_nibblebill/mod_nibblebill.c	2010-04-19 19:42:41 UTC (rev 17338)
@@ -337,9 +337,10 @@
 	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 @@
 	}
 	
 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;
 }