]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
don't leak on xferext ivr event, CID:1214232 Resource leak
authorMichael Jerris <mike@jerris.com>
Fri, 16 May 2014 14:50:18 +0000 (14:50 +0000)
committerMichael Jerris <mike@jerris.com>
Fri, 16 May 2014 14:50:18 +0000 (14:50 +0000)
src/switch_ivr.c

index db43e6a7bdbfc9a29727f265bd54378f85d537b1..ef4707b561805a1a592a6ff1a90068cfe4f05908 100644 (file)
@@ -696,13 +696,16 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se
                        
                        if (!strcasecmp(hp->name, "application")) {
                                app = strdup(hp->value);
-                               data = strchr(app, ' ');
-                       
-                               if (data) {
-                                       *data++ = '\0';
+                               if (app) {
+                                       data = strchr(app, ' ');
+
+                                       if (data) {
+                                               *data++ = '\0';
+                                       }
+
+                                       switch_caller_extension_add_application(session, extension, app, data);
+                                       free(app);
                                }
-                       
-                               switch_caller_extension_add_application(session, extension, app, data);
                        }
                }