shared-mime-info/Fix-potential-fd-leak-on-error-in-sync_file.patch
2019-09-30 11:17:06 -04:00

25 lines
636 B
Diff

From e94a220c30fe08991f5e72e9a02644b13a3fe0d2 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Tue, 24 Jul 2018 13:53:05 +0200
Subject: [PATCH 05/41] Fix potential fd leak on error in sync_file()
---
update-mime-database.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/update-mime-database.c b/update-mime-database.c
index dec1cfa..5780bd9 100644
--- a/update-mime-database.c
+++ b/update-mime-database.c
@@ -974,6 +974,7 @@ sync_file(const gchar *pathname, GError **error)
if (fdatasync(fd) == -1)
{
set_error_from_errno(error);
+ close(fd);
return -1;
}
if (close(fd) == -1)
--
1.8.3.1