projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
73db8be
)
Patch from Tito to fix memory leak upon error.
author
Glenn L McGrath
<bug1@ihug.co.nz>
Wed, 11 Aug 2004 03:50:30 +0000
(
03:50
-0000)
committer
Glenn L McGrath
<bug1@ihug.co.nz>
Wed, 11 Aug 2004 03:50:30 +0000
(
03:50
-0000)
libbb/xreadlink.c
patch
|
blob
|
history
diff --git
a/libbb/xreadlink.c
b/libbb/xreadlink.c
index 21a657dfc66cfd0dd8c3dd48f54f7ef85868020e..49823fa7f3e3a1fa9d9b05d33188a082b1a17f4e 100644
(file)
--- a/
libbb/xreadlink.c
+++ b/
libbb/xreadlink.c
@@
-24,8
+24,9
@@
extern char *xreadlink(const char *path)
buf = xrealloc(buf, bufsize += GROWBY);
readsize = readlink(path, buf, bufsize); /* 1st try */
if (readsize == -1) {
- bb_perror_msg("%s", path);
- return NULL;
+ bb_perror_msg("%s", path);
+ free(buf);
+ return NULL;
}
}
while (bufsize < readsize + 1);