mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-10 06:49:40 +00:00
Merge "Fix ast_(v)asprintf() malloc failure usage conditions." into 13
This commit is contained in:
@@ -721,7 +721,13 @@ int _ast_vasprintf(char **ret, const char *file, int lineno, const char *func, c
|
||||
|
||||
DEBUG_CHAOS_RETURN(DEBUG_CHAOS_ALLOC_CHANCE, -1);
|
||||
|
||||
if ((res = vasprintf(ret, fmt, ap)) == -1) {
|
||||
res = vasprintf(ret, fmt, ap);
|
||||
if (res < 0) {
|
||||
/*
|
||||
* *ret is undefined so set to NULL to ensure it is
|
||||
* initialized to something useful.
|
||||
*/
|
||||
*ret = NULL;
|
||||
MALLOC_FAILURE_MSG;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user