mirror of
https://github.com/sheumann/hush.git
synced 2025-01-12 14:30:54 +00:00
Patch from Tito to fix memory leak upon error.
This commit is contained in:
parent
73db8be80a
commit
18bbd9bf3b
@ -24,8 +24,9 @@ extern char *xreadlink(const char *path)
|
|||||||
buf = xrealloc(buf, bufsize += GROWBY);
|
buf = xrealloc(buf, bufsize += GROWBY);
|
||||||
readsize = readlink(path, buf, bufsize); /* 1st try */
|
readsize = readlink(path, buf, bufsize); /* 1st try */
|
||||||
if (readsize == -1) {
|
if (readsize == -1) {
|
||||||
bb_perror_msg("%s", path);
|
bb_perror_msg("%s", path);
|
||||||
return NULL;
|
free(buf);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (bufsize < readsize + 1);
|
while (bufsize < readsize + 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user