← Commit list

18bbd9bf3

Glenn L McGrath
Glenn L McGrath
2004-08-11
FAILED Duration: 52s

Subject

Patch from Tito to fix memory leak upon error.

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

libbb/xreadlink.c+3 -2
@@ -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);