Minor code cleanup. calling va_start without calling va_end doesn't leak does it? Either way, it's fixed now.

This commit is contained in:
William King 2013-05-18 20:15:14 -07:00
parent 9ace496fe3
commit e2ea6e58c8
2 changed files with 3 additions and 5 deletions

View File

@ -388,10 +388,6 @@ ESL_DECLARE(int) esl_event_add_array(esl_event_t *event, const char *var, const
p += 2; p += 2;
} }
if (!max) {
return -2;
}
data = strdup(val + 7); data = strdup(val + 7);
len = (sizeof(char *) * max) + 1; len = (sizeof(char *) * max) + 1;

View File

@ -1766,8 +1766,10 @@ SWITCH_DECLARE(switch_xml_t) switch_event_xmlize(switch_event_t *event, const ch
ret = vasprintf(&data, fmt, ap); ret = vasprintf(&data, fmt, ap);
#else #else
data = (char *) malloc(2048); data = (char *) malloc(2048);
if (!data) if (!data) {
va_end(ap);
return NULL; return NULL;
}
ret = vsnprintf(data, 2048, fmt, ap); ret = vsnprintf(data, 2048, fmt, ap);
#endif #endif
va_end(ap); va_end(ap);