lib/util: fix a memleak detected by clang-analyzer.

This commit is contained in:
Juan RP 2016-02-03 11:52:07 +01:00
parent f5f25a5ff4
commit 1e733f4daa

View File

@ -499,8 +499,8 @@ xbps_symlink_target(struct xbps_handle *xhp, const char *path, const char *tgt)
res = strdup(p1 + strlen(xhp->rootdir)); res = strdup(p1 + strlen(xhp->rootdir));
free(p1); free(p1);
} }
} free(p);
if (res == NULL) { } else {
if (strcmp(xhp->rootdir, "/") == 0) { if (strcmp(xhp->rootdir, "/") == 0) {
res = p; res = p;
} else { } else {