projects
/
oweals
/
opkg-lede.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3f13edd
)
libbb: xreadlink: fix memory leak on failure case
author
Yousong Zhou
<yszhou4tech@gmail.com>
Mon, 20 Mar 2017 02:46:15 +0000
(10:46 +0800)
committer
Yousong Zhou
<yszhou4tech@gmail.com>
Tue, 2 May 2017 14:12:49 +0000
(22:12 +0800)
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
libbb/xreadlink.c
patch
|
blob
|
history
diff --git
a/libbb/xreadlink.c
b/libbb/xreadlink.c
index 596a7638d1bf3aa594907493cb7f878e2ce7d0c1..29949d1ae96fbe06865fc4f4d2ff5df4a5468317 100644
(file)
--- a/
libbb/xreadlink.c
+++ b/
libbb/xreadlink.c
@@
-25,6
+25,7
@@
extern char *xreadlink(const char *path)
readsize = readlink(path, buf, bufsize); /* 1st try */
if (readsize == -1) {
perror_msg("%s", path);
+ free(buf);
return NULL;
}
}