projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
570cacb
)
mesa/util: don't ignore NULL returned from 'malloc'
author
Andrii Simiklit
<andrii.simiklit@globallogic.com>
Thu, 6 Sep 2018 14:43:53 +0000
(17:43 +0300)
committer
Eric Engestrom
<eric.engestrom@intel.com>
Thu, 6 Sep 2018 16:33:27 +0000
(17:33 +0100)
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: 864148d69e1e "util: add util_vasprintf() for Windows (v2)"
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
src/util/u_string.h
patch
|
blob
|
history
diff --git
a/src/util/u_string.h
b/src/util/u_string.h
index 374c00e0bcb9302cb11b629bcb3beae36fc7a39a..fb43ed0afc31623e0bbc61fc793af0f2bef0cce1 100644
(file)
--- a/
src/util/u_string.h
+++ b/
src/util/u_string.h
@@
-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 */