lkml.org 
[lkml]   [2016]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] modpost: free allocated memory
Date
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>
---
scripts/mod/modpost.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 48958d3..6607a04 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;
}
--
2.1.4
\
 
 \ /
  Last update: 2016-08-02 22:21    [W:0.025 / U:1.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site