]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix memory leak caused by regression from FS-2747
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 6 Oct 2010 21:04:42 +0000 (16:04 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 6 Oct 2010 21:05:13 +0000 (16:05 -0500)
src/mod/endpoints/mod_sofia/sofia_presence.c

index 3a01e1e003ea865bc6049a0286e67834ac69e018..b47fbd8bd368b8376b6b3a3288a74351e3522b55 100644 (file)
@@ -742,8 +742,8 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)
                        }
 
                        sofia_glue_execute_sql_callback(profile, NULL, sql, sofia_presence_sub_callback, &helper);
-
-
+                       switch_safe_free(sql);
+                       
                        sql = switch_mprintf("update sip_subscriptions set version=version+1 where event='dialog' and sub_to_user='%q' "
                                                                 "and (sub_to_host='%q' or presence_hosts like '%%%q%%') "
                                                                 "and (profile_name = '%q' or presence_hosts != sub_to_host)",
@@ -757,8 +757,6 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)
                                                                  event->event_id == SWITCH_EVENT_PRESENCE_IN ? "IN" : "OUT", profile->name);
                        }
 
-                       switch_safe_free(sql);
-
                        if (!zstr((char *) helper.stream.data)) {
                                char *this_sql = (char *) helper.stream.data;
                                char *next = NULL;