mirror of
https://github.com/asterisk/asterisk.git
synced 2026-07-07 15:19:24 -07:00
ast_malloc is sufficient here, since snprintf is called on the buffer
immediately after it gets allocated, which will automatically NULL terminate the string git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -515,7 +515,7 @@ char *ast_state2str(int state)
|
||||
default:
|
||||
pthread_once(&state2str_buf_once, state2str_buf_key_create);
|
||||
if (!(buf = pthread_getspecific(state2str_buf_key))) {
|
||||
if (!(buf = ast_calloc(1, STATE2STR_BUFSIZE)))
|
||||
if (!(buf = ast_malloc(STATE2STR_BUFSIZE)))
|
||||
return NULL;
|
||||
pthread_setspecific(state2str_buf_key, buf);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user