mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-12 04:48:51 +00:00
Merge "Fix ast_(v)asprintf() malloc failure usage conditions." into 15
This commit is contained in:
@@ -622,7 +622,13 @@ int __ast_vasprintf(char **ret, const char *fmt, va_list ap, const char *file, i
|
||||
|
||||
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