aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2010-08-11 03:42:26 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-11 11:58:59 -0400
commit5003bab82d56754b27be01eef24495a02e00039d (patch)
treef0b22810356657d8e1ad14a55e76a6b7873133af /scripts
parent3d30701b58970425e1d45994d6cb82f828924fdd (diff)
fix "scripts/mod/modpost.c: fix memory leak"
Fix error introduced by 37ed19d5cce35a40d3913cf9aa208ce9f60db3d7 ("scripts/mod/modpost.c: fix memory leak"). - don't kfree("") - fix one missed conversion Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Tested-by: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Alexey Fomenko <ext-alexey.fomenko@nokia.com> Cc: Trevor Keith <tsrk@tsrk.net> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Michal Marek <mmarek@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mod/modpost.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 1ce655dde99e..7acbdd8fcaed 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -14,6 +14,7 @@
14#define _GNU_SOURCE 14#define _GNU_SOURCE
15#include <stdio.h> 15#include <stdio.h>
16#include <ctype.h> 16#include <ctype.h>
17#include <string.h>
17#include "modpost.h" 18#include "modpost.h"
18#include "../../include/generated/autoconf.h" 19#include "../../include/generated/autoconf.h"
19#include "../../include/linux/license.h" 20#include "../../include/linux/license.h"
@@ -1217,7 +1218,7 @@ static char *sec2annotation(const char *s)
1217 strcat(p, " "); 1218 strcat(p, " ");
1218 return r; /* we leak her but we do not care */ 1219 return r; /* we leak her but we do not care */
1219 } else { 1220 } else {
1220 return ""; 1221 return strdup("");
1221 } 1222 }
1222} 1223}
1223 1224
@@ -1352,7 +1353,7 @@ static void report_sec_mismatch(const char *modname,
1352 "%s%s so it may be used outside an exit section.\n", 1353 "%s%s so it may be used outside an exit section.\n",
1353 from, prl_from, fromsym, from_p, 1354 from, prl_from, fromsym, from_p,
1354 to, prl_to, tosym, to_p, 1355 to, prl_to, tosym, to_p,
1355 sec2annotation(tosec), tosym, to_p); 1356 prl_to, tosym, to_p);
1356 free(prl_from); 1357 free(prl_from);
1357 free(prl_to); 1358 free(prl_to);
1358 break; 1359 break;