diff options
author | Alan Cox <alan@linux.intel.com> | 2012-11-06 09:32:08 -0500 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2012-11-20 06:12:47 -0500 |
commit | 177acf78468bf5c359bcb8823ee3bd48b04b8380 (patch) | |
tree | 08bd5614d4147060d25278aa54e8f8bab9794677 /scripts/kconfig/zconf.l | |
parent | 9a926d4354d84e424e738a6d401328340400331b (diff) |
kconfig: Fix malloc handling in conf tools
(and get them out of the noise in the audit work)
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts/kconfig/zconf.l')
-rw-r--r-- | scripts/kconfig/zconf.l | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index 00f9d3a9cf8b..6555a475453b 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l | |||
@@ -40,7 +40,7 @@ static void zconf_endfile(void); | |||
40 | 40 | ||
41 | static void new_string(void) | 41 | static void new_string(void) |
42 | { | 42 | { |
43 | text = malloc(START_STRSIZE); | 43 | text = xmalloc(START_STRSIZE); |
44 | text_asize = START_STRSIZE; | 44 | text_asize = START_STRSIZE; |
45 | text_size = 0; | 45 | text_size = 0; |
46 | *text = 0; | 46 | *text = 0; |
@@ -62,7 +62,7 @@ static void append_string(const char *str, int size) | |||
62 | 62 | ||
63 | static void alloc_string(const char *str, int size) | 63 | static void alloc_string(const char *str, int size) |
64 | { | 64 | { |
65 | text = malloc(size + 1); | 65 | text = xmalloc(size + 1); |
66 | memcpy(text, str, size); | 66 | memcpy(text, str, size); |
67 | text[size] = 0; | 67 | text[size] = 0; |
68 | } | 68 | } |
@@ -288,7 +288,7 @@ void zconf_initscan(const char *name) | |||
288 | exit(1); | 288 | exit(1); |
289 | } | 289 | } |
290 | 290 | ||
291 | current_buf = malloc(sizeof(*current_buf)); | 291 | current_buf = xmalloc(sizeof(*current_buf)); |
292 | memset(current_buf, 0, sizeof(*current_buf)); | 292 | memset(current_buf, 0, sizeof(*current_buf)); |
293 | 293 | ||
294 | current_file = file_lookup(name); | 294 | current_file = file_lookup(name); |
@@ -299,7 +299,7 @@ void zconf_nextfile(const char *name) | |||
299 | { | 299 | { |
300 | struct file *iter; | 300 | struct file *iter; |
301 | struct file *file = file_lookup(name); | 301 | struct file *file = file_lookup(name); |
302 | struct buffer *buf = malloc(sizeof(*buf)); | 302 | struct buffer *buf = xmalloc(sizeof(*buf)); |
303 | memset(buf, 0, sizeof(*buf)); | 303 | memset(buf, 0, sizeof(*buf)); |
304 | 304 | ||
305 | current_buf->state = YY_CURRENT_BUFFER; | 305 | current_buf->state = YY_CURRENT_BUFFER; |