mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 09:28:07 +02:00
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 <eric.engestrom@intel.com> Fixes:864148d69e"util: add util_vasprintf() for Windows (v2)" Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com> (cherry picked from commit65cfe698b0)
This commit is contained in:
parent
4a44ff8bad
commit
a17aed452d
1 changed files with 1 additions and 1 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue