From: Heinrich Schuchardt Date: Tue, 2 Aug 2016 19:43:01 +0000 (+0200) Subject: modpost: free allocated memory X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c7d47f26df949f0031fe2905068ee85db1b63ed9;p=linux.git 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 Signed-off-by: Rusty Russell Link: http://lkml.kernel.org/r/1470166981-6461-1-git-send-email-xypron.glpk@gmx.de Signed-off-by: Jessica Yu --- diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index bd83497590951..5a6b39a29b7a7 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -2371,6 +2371,7 @@ static void write_dump(const char *fname) } } write_if_changed(&buf, fname); + free(buf.p); } struct ext_sym_list { @@ -2496,6 +2497,7 @@ int main(int argc, char **argv) "Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.\n"); } } + free(buf.p); return err; }