libalpm: free trans before databases

When releasing the handle, alpm tries to do some self clean up by
freeing the databases and transaction.

However, databases refuse to unregister is there is an in progress
transaction. Causing them to leak if the handle is released while
a transaction is active.
This commit is contained in:
morganamilo 2023-01-27 01:54:04 +00:00
parent 015cdb21bd
commit 5e52dc0906
No known key found for this signature in database
GPG key ID: E48D0A8326DE47C5

View file

@ -100,6 +100,11 @@ int SYMEXPORT alpm_release(alpm_handle_t *myhandle)
CHECK_HANDLE(myhandle, return -1);
/* free transaction memory */
if(myhandle->trans && alpm_trans_release(myhandle) == -1) {
return -1;
}
/* close local database */
db = myhandle->db_local;
if(db) {