don't leak

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12721 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Rupa Schomaker 2009-03-23 15:34:46 +00:00
parent f5d97f2fb3
commit 8c1dee5ac9
1 changed files with 3 additions and 0 deletions

View File

@ -563,6 +563,8 @@ switch_status_t lcr_do_lookup(callback_t *cb_struct, char *digits)
/* format the custom_sql */
safe_sql = format_custom_sql(profile->custom_sql, cb_struct, digits_copy);
if (!safe_sql) {
switch_event_safe_destroy(&cb_struct->event);
switch_core_hash_destroy(&cb_struct->dedup_hash);
return SWITCH_STATUS_GENERR;
}
SWITCH_STANDARD_STREAM(sql_stream);
@ -577,6 +579,7 @@ switch_status_t lcr_do_lookup(callback_t *cb_struct, char *digits)
lookup_status = lcr_execute_sql_callback((char *)sql_stream.data, route_add_callback, cb_struct);
switch_safe_free(sql_stream.data);
switch_event_safe_destroy(&cb_struct->event);
switch_core_hash_destroy(&cb_struct->dedup_hash);
if (lookup_status) {