diff --git a/lib/package_remove.c b/lib/package_remove.c index 04d6e008..623a8052 100644 --- a/lib/package_remove.c +++ b/lib/package_remove.c @@ -123,6 +123,7 @@ symlink_target(struct xbps_handle *xhp, const char *path) assert(p); if (strstr(p, "./") && ((p1 = realpath(p, NULL)))) { res = strdup(p1 + strlen(xhp->rootdir)); + free(p1); } if (res == NULL) { res = strdup(p + strlen(xhp->rootdir)+1);