Commit 65cfe698 authored by Andrii Simiklit's avatar Andrii Simiklit Committed by Eric Engestrom

mesa/util: don't ignore NULL returned from 'malloc'

We should exit from the function 'util_vasprintf'
with error code -1 for case where 'malloc'
returns NULL
Reviewed-by: Eric Engestrom's avatarEric Engestrom <eric.engestrom@intel.com>
Fixes: 864148d6 "util: add util_vasprintf() for Windows (v2)"
Signed-off-by: default avatarAndrii Simiklit <andrii.simiklit@globallogic.com>
parent 570cacba
......@@ -126,7 +126,7 @@ util_vasprintf(char **ret, const char *format, va_list ap)
return -1;
*ret = (char *) malloc(r + 1);
if (!ret)
if (!*ret)
return -1;
/* Print to buffer */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment