xbps_symlink_target: fix a meamleak reported by clang-analyzer.
This commit is contained in:
parent
a00c7b1c4b
commit
bb977c73e4
@ -502,14 +502,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 {
|
||||
res = strdup(p);
|
||||
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