xbps_symlink_target: double free in rootdir == '/' case.
This commit is contained in:
parent
6d65e76f91
commit
9083191e4b
@ -503,12 +503,13 @@ xbps_symlink_target(struct xbps_handle *xhp, const char *path, const char *tgt)
|
||||
if (res == NULL) {
|
||||
if (strcmp(xhp->rootdir, "/") == 0)
|
||||
res = p;
|
||||
else
|
||||
else {
|
||||
res = strdup(p + strlen(xhp->rootdir));
|
||||
free(p);
|
||||
}
|
||||
}
|
||||
assert(res);
|
||||
free(lnk);
|
||||
free(p);
|
||||
} else {
|
||||
/* absolute */
|
||||
res = lnk;
|
||||
|
Loading…
Reference in New Issue
Block a user