Commit c7d47f26 authored by Heinrich Schuchardt's avatar Heinrich Schuchardt Committed by Jessica Yu

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: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Link: http://lkml.kernel.org/r/1470166981-6461-1-git-send-email-xypron.glpk@gmx.deSigned-off-by: default avatarJessica Yu <jeyu@redhat.com>
parent a25f0944
...@@ -2371,6 +2371,7 @@ static void write_dump(const char *fname) ...@@ -2371,6 +2371,7 @@ static void write_dump(const char *fname)
} }
} }
write_if_changed(&buf, fname); write_if_changed(&buf, fname);
free(buf.p);
} }
struct ext_sym_list { struct ext_sym_list {
...@@ -2496,6 +2497,7 @@ int main(int argc, char **argv) ...@@ -2496,6 +2497,7 @@ int main(int argc, char **argv)
"Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.\n"); "Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.\n");
} }
} }
free(buf.p);
return err; return err;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment