aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2016-08-02 15:43:01 -0400
committerJessica Yu <jeyu@redhat.com>2016-11-26 14:18:01 -0500
commitc7d47f26df949f0031fe2905068ee85db1b63ed9 (patch)
treeb4ea46b0a1be0cd5e09516ace24e4a10b04e09cb
parenta25f0944ba9b1d8a6813fd6f1a86f1bd59ac25a6 (diff)
modpost: free allocated memory
valgrind complains that memory is not freed after allocation with realloc() called from main() and write_dump(). So let us free the allocated memory properly. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Link: http://lkml.kernel.org/r/1470166981-6461-1-git-send-email-xypron.glpk@gmx.de Signed-off-by: Jessica Yu <jeyu@redhat.com>
-rw-r--r--scripts/mod/modpost.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index bd8349759095..5a6b39a29b7a 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -2371,6 +2371,7 @@ static void write_dump(const char *fname)
2371 } 2371 }
2372 } 2372 }
2373 write_if_changed(&buf, fname); 2373 write_if_changed(&buf, fname);
2374 free(buf.p);
2374} 2375}
2375 2376
2376struct ext_sym_list { 2377struct ext_sym_list {
@@ -2496,6 +2497,7 @@ int main(int argc, char **argv)
2496 "Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.\n"); 2497 "Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.\n");
2497 } 2498 }
2498 } 2499 }
2500 free(buf.p);
2499 2501
2500 return err; 2502 return err;
2501} 2503}