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:
parent
357acc8117
commit
df7ce0d951
|
@ -531,7 +531,6 @@ SWITCH_DECLARE(switch_status_t) switch_event_add_body(switch_event_t *event, cha
|
||||||
ret = vsnprintf(data, 2048, fmt, ap);
|
ret = vsnprintf(data, 2048, fmt, ap);
|
||||||
#endif
|
#endif
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
|
||||||
|
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
return SWITCH_STATUS_GENERR;
|
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;
|
event->body = data;
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return SWITCH_STATUS_GENERR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(void) switch_event_destroy(switch_event_t **event)
|
SWITCH_DECLARE(void) switch_event_destroy(switch_event_t **event)
|
||||||
|
|
Loading…
Reference in New Issue