/[packages]/cauldron/mesa/current/SOURCES/0008-mesa-util-don-t-ignore-NULL-returned-from-malloc.patch
ViewVC logotype

Contents of /cauldron/mesa/current/SOURCES/0008-mesa-util-don-t-ignore-NULL-returned-from-malloc.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1257897 - (show annotations) (download)
Sat Sep 8 20:31:12 2018 UTC (5 years, 7 months ago) by tmb
File size: 1046 byte(s)
add fixes from staging/18.2 branch
1 From 841dc893ca67fe2d35fb2831d48556beb14ee454 Mon Sep 17 00:00:00 2001
2 From: Andrii Simiklit <andrii.simiklit@globallogic.com>
3 Date: Thu, 6 Sep 2018 17:43:53 +0300
4 Subject: [PATCH 08/20] mesa/util: don't ignore NULL returned from 'malloc'
5
6 We should exit from the function 'util_vasprintf'
7 with error code -1 for case where 'malloc'
8 returns NULL
9
10 Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
11 Fixes: 864148d69e1e "util: add util_vasprintf() for Windows (v2)"
12 Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
13 (cherry picked from commit 65cfe698b0f4ba412198d212c14481a60c1b8389)
14 ---
15 src/util/u_string.h | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18 diff --git a/src/util/u_string.h b/src/util/u_string.h
19 index 374c00e0bc..fb43ed0afc 100644
20 --- a/src/util/u_string.h
21 +++ b/src/util/u_string.h
22 @@ -126,7 +126,7 @@ util_vasprintf(char **ret, const char *format, va_list ap)
23 return -1;
24
25 *ret = (char *) malloc(r + 1);
26 - if (!ret)
27 + if (!*ret)
28 return -1;
29
30 /* Print to buffer */
31 --
32 2.18.0
33

  ViewVC Help
Powered by ViewVC 1.1.30