diff --git a/bin/xbps-pkgdb/check.c b/bin/xbps-pkgdb/check.c index 4cb73585..20ce73a5 100644 --- a/bin/xbps-pkgdb/check.c +++ b/bin/xbps-pkgdb/check.c @@ -139,7 +139,9 @@ check_pkg_integrity(struct xbps_handle *xhp, /* * Check for props.plist metadata file. */ - propsd = xbps_pkgdb_get_pkg_metadata(xhp, pkgname); + buf = xbps_xasprintf("%s/.%s.plist", xhp->metadir, pkgname); + propsd = prop_dictionary_internalize_from_file(buf); + free(buf); if (propsd == NULL) { printf("%s: unexistent metafile, converting to 0.18 " "format...\n", pkgname); @@ -150,6 +152,7 @@ check_pkg_integrity(struct xbps_handle *xhp, } else if (prop_dictionary_count(propsd) == 0) { xbps_error_printf("%s: incomplete metadata file.\n", pkgname); + prop_object_release(propsd); return 1; } /* @@ -177,6 +180,7 @@ check_pkg_integrity(struct xbps_handle *xhp, rv = xbps_file_hash_check(buf, sha256); free(buf); if (rv == ERANGE) { + prop_object_release(propsd); fprintf(stderr, "%s: metadata file has been " "modified!\n", pkgname); return 1; @@ -199,6 +203,8 @@ do { \ RUN_PKG_CHECK(xhp, rundeps, propsd); RUN_PKG_CHECK(xhp, unneeded, opkgd); + prop_object_release(propsd); + #undef RUN_PKG_CHECK if ((rv == 0) && (pkgd == NULL)) diff --git a/bin/xbps-pkgdb/check_pkg_files.c b/bin/xbps-pkgdb/check_pkg_files.c index 0b07aa3b..1a886e6b 100644 --- a/bin/xbps-pkgdb/check_pkg_files.c +++ b/bin/xbps-pkgdb/check_pkg_files.c @@ -69,6 +69,7 @@ check_pkg_files(struct xbps_handle *xhp, const char *pkgname, void *arg) prop_dictionary_get_cstring_nocopy(obj, "sha256", &sha256); rv = xbps_file_hash_check(path, sha256); + free(path); switch (rv) { case 0: break; @@ -93,7 +94,6 @@ check_pkg_files(struct xbps_handle *xhp, const char *pkgname, void *arg) pkgname, file, strerror(rv)); break; } - free(path); } prop_object_iterator_release(iter); } diff --git a/bin/xbps-pkgdb/check_pkg_symlinks.c b/bin/xbps-pkgdb/check_pkg_symlinks.c index 25488ab6..a4d19859 100644 --- a/bin/xbps-pkgdb/check_pkg_symlinks.c +++ b/bin/xbps-pkgdb/check_pkg_symlinks.c @@ -122,6 +122,9 @@ check_pkg_symlinks(struct xbps_handle *xhp, const char *pkgname, void *arg) if (buf2 == NULL) { xbps_warn_printf("%s: broken symlink %s (target: %s)\n", pkgname, file, tgt); + free(path); + free(tgt_path); + free(p); free(buf); free(lnk); continue; @@ -150,6 +153,7 @@ check_pkg_symlinks(struct xbps_handle *xhp, const char *pkgname, void *arg) free(buf); free(path); free(tgt_path); + free(lnk); } return broken; }