Skip to content

Commit 4589625

Browse files
committed
bin/xbps-query: fix memory leak in --search
1 parent 213c829 commit 4589625

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

bin/xbps-query/search.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,12 @@ search(struct xbps_handle *xhp, bool repo_mode, const char *pat, const char *pro
255255
return rv;
256256
}
257257
}
258-
if (!prop && xbps_array_count(sd.results)) {
258+
259+
if (!prop && xbps_array_count(sd.results))
259260
print_results(xhp, &sd);
260-
xbps_object_release(sd.results);
261-
}
261+
262+
xbps_object_release(sd.results);
263+
262264
if (regex)
263265
regfree(&sd.regexp);
264266

0 commit comments

Comments
 (0)