libblockdev/0015-swap-Fix-memory-leak.patch

25 lines
715 B
Diff
Raw Normal View History

From 58e7484228fcfbffc439a9d5131a221dd9e35d5f Mon Sep 17 00:00:00 2001
From: Vojtech Trefny <vtrefny@redhat.com>
Date: Fri, 25 Sep 2020 14:27:54 +0200
Subject: [PATCH 15/15] swap: Fix memory leak
---
src/plugins/swap.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/plugins/swap.c b/src/plugins/swap.c
index 102780a..115f8fc 100644
--- a/src/plugins/swap.c
+++ b/src/plugins/swap.c
@@ -417,6 +417,7 @@ gboolean bd_swap_swapstatus (const gchar *device, GError **error) {
if (!real_device) {
/* the device doesn't exist and thus is not an active swap */
g_clear_error (error);
+ g_free (file_content);
return FALSE;
}
}
--
1.8.3.1