lib/util: fix a memleak detected by clang-analyzer.
This commit is contained in:
parent
f5f25a5ff4
commit
1e733f4daa
@ -499,8 +499,8 @@ xbps_symlink_target(struct xbps_handle *xhp, const char *path, const char *tgt)
|
||||
res = strdup(p1 + strlen(xhp->rootdir));
|
||||
free(p1);
|
||||
}
|
||||
}
|
||||
if (res == NULL) {
|
||||
free(p);
|
||||
} else {
|
||||
if (strcmp(xhp->rootdir, "/") == 0) {
|
||||
res = p;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user