diff options
author | Manjeet Pawar <manjeet.p@samsung.com> | 2015-05-28 04:44:31 +0000 |
---|---|---|
committer | Cyril Hrubis <chrubis@suse.cz> | 2015-06-01 16:46:57 +0200 |
commit | 72a6f86864c7e17510a996b0437fb06041c6779c (patch) | |
tree | 26d5fd18b2f7f8ebd3d57234daf014a7558162c0 /pan | |
parent | c414040fa5f53e353f25c6d5d550dc42a62d32f7 (diff) |
pan/ltp-pan.c: avoid memory leak
This patch avoid memory leak by freeing the buf before the slurp()
function return.
Signed-off-by: Yogesh Gaur <yn.gaur@samsung.com>
Signed-off-by: Manjeet Pawar <manjeet.p@samsung.com>
Diffstat (limited to 'pan')
-rw-r--r-- | pan/ltp-pan.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/pan/ltp-pan.c b/pan/ltp-pan.c index 4c1e9deb6..905ff89f5 100644 --- a/pan/ltp-pan.c +++ b/pan/ltp-pan.c @@ -1279,6 +1279,7 @@ static char *slurp(char *file) if (read(fd, buf, sbuf.st_size) != sbuf.st_size) { fprintf(stderr, "pan(%s): slurp failed. errno:%d %s\n", panname, errno, strerror(errno)); + free(buf); return NULL; } buf[sbuf.st_size] = '\0'; |