Skip to content

Commit 62c5274

Browse files
committed
lib: free memory from xbps_handle in xbps_end
1 parent f8f31a1 commit 62c5274

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

lib/initend.c

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,41 @@ xbps_end(struct xbps_handle *xhp)
192192
assert(xhp);
193193

194194
xbps_pkgdb_release(xhp);
195+
196+
if (xhp->vpkgd) {
197+
xbps_object_release(xhp->vpkgd);
198+
xhp->vpkgd = NULL;
199+
}
200+
if (xhp->vpkgd_conf) {
201+
xbps_object_release(xhp->vpkgd_conf);
202+
xhp->vpkgd_conf = NULL;
203+
}
204+
if (xhp->pkgdb_revdeps) {
205+
xbps_object_release(xhp->pkgdb_revdeps);
206+
xhp->pkgdb_revdeps = NULL;
207+
}
208+
if (xhp->transd) {
209+
xbps_object_release(xhp->transd);
210+
xhp->transd = NULL;
211+
}
212+
213+
if (xhp->preserved_files) {
214+
xbps_object_release(xhp->preserved_files);
215+
xhp->preserved_files = NULL;
216+
}
217+
if (xhp->noextract) {
218+
xbps_object_release(xhp->noextract);
219+
xhp->noextract = NULL;
220+
}
221+
if (xhp->ignored_pkgs) {
222+
xbps_object_release(xhp->ignored_pkgs);
223+
xhp->ignored_pkgs= NULL;
224+
}
225+
if (xhp->repositories) {
226+
xbps_object_release(xhp->repositories);
227+
xhp->ignored_pkgs= NULL;
228+
}
229+
230+
free(xhp->pkgdb_plist);
231+
xhp->pkgdb_plist = NULL;
195232
}

0 commit comments

Comments
 (0)