xbps_symlink_target: fix bb977c7
(v2).
This commit is contained in:
parent
4c655fd56a
commit
d984eeeb47
@ -498,18 +498,20 @@ xbps_symlink_target(struct xbps_handle *xhp, const char *path, const char *tgt)
|
|||||||
} else {
|
} else {
|
||||||
res = strdup(p1 + strlen(xhp->rootdir));
|
res = strdup(p1 + strlen(xhp->rootdir));
|
||||||
}
|
}
|
||||||
|
assert(res);
|
||||||
free(p1);
|
free(p1);
|
||||||
|
free(p);
|
||||||
}
|
}
|
||||||
if (res == NULL) {
|
if (res == NULL) {
|
||||||
if (strcmp(xhp->rootdir, "/") == 0) {
|
if (strcmp(xhp->rootdir, "/") == 0) {
|
||||||
res = strdup(p);
|
res = p;
|
||||||
} else {
|
} else {
|
||||||
res = strdup(p + strlen(xhp->rootdir));
|
res = strdup(p + strlen(xhp->rootdir));
|
||||||
|
free(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert(res);
|
assert(res);
|
||||||
free(lnk);
|
free(lnk);
|
||||||
free(p);
|
|
||||||
} else {
|
} else {
|
||||||
/* absolute */
|
/* absolute */
|
||||||
res = lnk;
|
res = lnk;
|
||||||
|
Loading…
Reference in New Issue
Block a user