From 7147b44123a18210f9bb39b615ae6409bd214042 Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Sat, 25 Mar 2006 03:07:46 -0800 Subject: [PATCH] --- yaml --- r: 23573 b: refs/heads/master c: f1a136e0d098a4478236a1c24f9a57db5abf0755 h: refs/heads/master i: 23571: cd412cc2ce8f90ccfa085dc9af3aee2d618db9d7 v: v3 --- [refs] | 2 +- trunk/scripts/kallsyms.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 323c8861e63c..ce3eed53c0f1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2ab13460852e65c2ec0e77000baba5e859a6a2cf +refs/heads/master: f1a136e0d098a4478236a1c24f9a57db5abf0755 diff --git a/trunk/scripts/kallsyms.c b/trunk/scripts/kallsyms.c index d591578bd3b2..22d281c6ec24 100644 --- a/trunk/scripts/kallsyms.c +++ b/trunk/scripts/kallsyms.c @@ -124,6 +124,11 @@ static int read_symbol(FILE *in, struct sym_entry *s) * compressed together */ s->len = strlen(str) + 1; s->sym = malloc(s->len + 1); + if (!s->sym) { + fprintf(stderr, "kallsyms failure: " + "unable to allocate required amount of memory\n"); + exit(EXIT_FAILURE); + } strcpy((char *)s->sym + 1, str); s->sym[0] = stype; @@ -272,7 +277,12 @@ static void write_src(void) /* table of offset markers, that give the offset in the compressed stream * every 256 symbols */ - markers = (unsigned int *) malloc(sizeof(unsigned int) * ((table_cnt + 255) / 256)); + markers = malloc(sizeof(unsigned int) * ((table_cnt + 255) / 256)); + if (!markers) { + fprintf(stderr, "kallsyms failure: " + "unable to allocate required memory\n"); + exit(EXIT_FAILURE); + } output_label("kallsyms_names"); off = 0;