Skip to content

Commit

Permalink
modpost: free allocated memory
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Jessica Yu <[email protected]>
  • Loading branch information
xypron authored and Jessica Yu committed Nov 26, 2016
1 parent a25f094 commit c7d47f2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/mod/modpost.c
Original file line number Diff line number Diff line change
Expand Up @@ -2371,6 +2371,7 @@ static void write_dump(const char *fname)
}
}
write_if_changed(&buf, fname);
free(buf.p);
}

struct ext_sym_list {
Expand Down Expand Up @@ -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;
}

0 comments on commit c7d47f2

Please sign in to comment.