You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ag...@apache.org on 2020/07/23 14:49:21 UTC
[incubator-nuttx] branch master updated: tools/incdir: Fix the
memory leak
This is an automated email from the ASF dual-hosted git repository.
aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 6be8dd4 tools/incdir: Fix the memory leak
6be8dd4 is described below
commit 6be8dd420c9ab7b4a9e63eab9bce17bce7e92464
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Thu Jul 23 18:17:20 2020 +0800
tools/incdir: Fix the memory leak
Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
Change-Id: I9bf57071b5e967a3db55c7e473e84a8bad44cd2a
---
tools/incdir.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tools/incdir.c b/tools/incdir.c
index 7d3c24f..4cef6ea 100644
--- a/tools/incdir.c
+++ b/tools/incdir.c
@@ -476,6 +476,11 @@ int main(int argc, char **argv, char **envp)
/* Clean up for the next pass */
+ if (saveresp != NULL)
+ {
+ free(saveresp);
+ }
+
if (segment != NULL)
{
free(segment);
@@ -492,5 +497,7 @@ int main(int argc, char **argv, char **envp)
}
fputs(response, stdout);
+ free(response);
+
return EXIT_SUCCESS;
}