]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3137 --resolve less of a memory leak more of a pool swelling, replaced a pool...
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 8 Apr 2011 19:04:01 +0000 (14:04 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 8 Apr 2011 19:04:01 +0000 (14:04 -0500)
src/mod/applications/mod_conference/mod_conference.c

index 16451b66a92b5a18d8892a5c2a9a066a212d1e27..07a24355cfbd65e5c4add8c22b064ace55903b23 100644 (file)
@@ -1996,22 +1996,20 @@ static void conference_loop_fn_exec_app(conference_member_t *member, caller_cont
                switch_event_fire(&event);
        }
 
-       if ((mydata = switch_core_session_strdup(member->session, action->expanded_data))) {
-               if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
-                       if (argc > 0) {
-                               app = argv[0];
-                       }
-                       if (argc > 1) {
-                               arg = argv[1];
-                       }
+       mydata = strdup(action->expanded_data);
+       switch_assert(mydata);
 
-               } else {
-                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(member->session), SWITCH_LOG_ERROR, "Empty execute app string [%s]\n", 
-                                                         (char *) action->expanded_data);
-                       goto done;
+       if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
+               if (argc > 0) {
+                       app = argv[0];
+               }
+               if (argc > 1) {
+                       arg = argv[1];
                }
+
        } else {
-               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(member->session), SWITCH_LOG_ERROR, "Unable to allocate memory to duplicate execute_app data.\n");
+               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(member->session), SWITCH_LOG_ERROR, "Empty execute app string [%s]\n", 
+                                                 (char *) action->expanded_data);
                goto done;
        }
 
@@ -2029,8 +2027,11 @@ static void conference_loop_fn_exec_app(conference_member_t *member, caller_cont
        switch_core_session_execute_application(member->session, app, arg);
        switch_core_session_set_read_codec(member->session, &member->read_codec);
        switch_channel_clear_app_flag(channel, CF_APP_TAGGED);
+
   done:
 
+       switch_safe_free(mydata);
+
        return;
 }