Skip to content

Commit e284cb6

Browse files
committed
bin/xbps-query: fix memory leak in --files
1 parent ea93592 commit e284cb6

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

bin/xbps-query/show-info-files.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,15 +251,15 @@ show_pkg_info_from_metadir(struct xbps_handle *xhp,
251251
int
252252
show_pkg_files_from_metadir(struct xbps_handle *xhp, const char *pkg)
253253
{
254-
xbps_dictionary_t d;
254+
xbps_dictionary_t filesd;
255255
int rv = 0;
256256

257-
d = xbps_pkgdb_get_pkg_files(xhp, pkg);
258-
if (d == NULL)
257+
filesd = xbps_pkgdb_get_pkg_files(xhp, pkg);
258+
if (filesd == NULL)
259259
return ENOENT;
260260

261-
rv = show_pkg_files(d);
262-
261+
rv = show_pkg_files(filesd);
262+
xbps_object_release(filesd);
263263
return rv;
264264
}
265265

@@ -341,7 +341,7 @@ repo_show_pkg_files(struct xbps_handle *xhp, const char *pkg)
341341

342342
filesd = xbps_archive_fetch_plist(bfile, "/files.plist");
343343
if (filesd == NULL) {
344-
if (errno != ENOTSUP && errno != ENOENT) {
344+
if (errno != ENOTSUP && errno != ENOENT) {
345345
xbps_error_printf("Unexpected error: %s\n", strerror(errno));
346346
}
347347
return errno;

0 commit comments

Comments
 (0)