]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix small mem leak in util func
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 13 Jul 2010 21:52:32 +0000 (16:52 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 13 Jul 2010 21:52:32 +0000 (16:52 -0500)
src/switch_event.c

index c2cbc7cb2e3ffdcf4d7214bf68f140a50b37b112..eccc695679241d3f57354bcd46f95ec71709aa9c 100644 (file)
@@ -1062,8 +1062,8 @@ SWITCH_DECLARE(switch_status_t) switch_event_create_brackets(char *data, char a,
        int var_count = 0;
        char *next;
        
-       vdata = strdup(data);
-       vdatap = vdata;
+       vdatap = strdup(data);
+       vdata = vdatap;
 
        end = switch_find_end_paren(vdata, a, b);
        
@@ -1081,7 +1081,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_create_brackets(char *data, char a,
                vdata++;
                *end++ = '\0';
        } else {
-               vdata = NULL;
+               free(vdatap);
                return SWITCH_STATUS_FALSE;
        }