]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Minor code cleanup. calling va_start without calling va_end doesn't leak does it...
authorWilliam King <william.king@quentustech.com>
Sun, 19 May 2013 03:15:14 +0000 (20:15 -0700)
committerWilliam King <william.king@quentustech.com>
Sun, 19 May 2013 03:15:14 +0000 (20:15 -0700)
libs/esl/src/esl_event.c
src/switch_event.c

index a953964c3e39ae1badb83c8c0e440e90ee61ccca..e9985d9d6d719d0834e02babd8ac16f4f90eacf8 100644 (file)
@@ -388,10 +388,6 @@ ESL_DECLARE(int) esl_event_add_array(esl_event_t *event, const char *var, const
                p += 2;
        }
 
-       if (!max) {
-               return -2;
-       }
-
        data = strdup(val + 7);
        
        len = (sizeof(char *) * max) + 1;
index b93f8746ad4713d7ae6811aa9d49ac015b0104af..e932a067d57dffa324dbef651ac25ef939629429 100644 (file)
@@ -1766,8 +1766,10 @@ SWITCH_DECLARE(switch_xml_t) switch_event_xmlize(switch_event_t *event, const ch
                ret = vasprintf(&data, fmt, ap);
 #else
                data = (char *) malloc(2048);
-               if (!data)
+               if (!data) {
+                       va_end(ap);
                        return NULL;
+               }
                ret = vsnprintf(data, 2048, fmt, ap);
 #endif
                va_end(ap);