fix segfault

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2296 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2006-08-15 15:57:20 +00:00
parent e54c549840
commit acf84d7631
1 changed files with 5 additions and 3 deletions

View File

@ -441,9 +441,11 @@ SWITCH_DECLARE(switch_status_t) switch_event_add_body(switch_event_t *event, cha
char data[2048];
va_list ap;
va_start(ap, fmt);
vsnprintf(data, sizeof(data), fmt, ap);
va_end(ap);
if (fmt) {
va_start(ap, fmt);
vsnprintf(data, sizeof(data), fmt, ap);
va_end(ap);
}
if (ret == -1) {
return SWITCH_STATUS_MEMERR;