From 167289d590767ad93db6fcf3b5a30f9b8007c1c4 Mon Sep 17 00:00:00 2001 From: gt7-void Date: Sat, 11 Jul 2020 18:27:50 -0300 Subject: [PATCH] Avoid file descriptor leakes (fix #303) HTTP connections are cached for performance, but they end up being leaked when running configure scripts. To avoid this, close the connection cache after all downloads are finished. Closes: #326 [via git-merge-pr] --- lib/transaction_commit.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/transaction_commit.c b/lib/transaction_commit.c index 27500aa8..bedd6285 100644 --- a/lib/transaction_commit.c +++ b/lib/transaction_commit.c @@ -104,6 +104,12 @@ xbps_transaction_commit(struct xbps_handle *xhp) goto out; } + /* + * After all downloads are finished, clear the connection cache + * to avoid file descriptor leaks (see #303) + */ + xbps_fetch_unset_cache_connection(); + /* * Collect files in the transaction and find some issues * like multiple packages installing the same file.