don't use uninitialized value of data, return error if null fmt string passed.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4116 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2007-02-04 19:12:14 +00:00
parent 357acc8117
commit df7ce0d951
1 changed files with 7 additions and 5 deletions

View File

@ -531,7 +531,6 @@ SWITCH_DECLARE(switch_status_t) switch_event_add_body(switch_event_t *event, cha
ret = vsnprintf(data, 2048, fmt, ap);
#endif
va_end(ap);
}
if (ret == -1) {
return SWITCH_STATUS_GENERR;
@ -539,6 +538,9 @@ SWITCH_DECLARE(switch_status_t) switch_event_add_body(switch_event_t *event, cha
event->body = data;
return SWITCH_STATUS_SUCCESS;
}
} else {
return SWITCH_STATUS_GENERR;
}
}
SWITCH_DECLARE(void) switch_event_destroy(switch_event_t **event)