From 554df2a8d9bf606ff109707d13ae3ab0bdf3723b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 4 Feb 2020 20:01:15 +0100 Subject: [PATCH] utils: Fix memory leak when error is ignored in list If we get a `NoEnrolledPrints` error while list, we don't consider it an hard error and in such case we proceed to releasing the device, but without clearing the previously set error first. --- utils/list.c | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/list.c b/utils/list.c index 2284c4c..8098c0c 100644 --- a/utils/list.c +++ b/utils/list.c @@ -55,6 +55,7 @@ static void list_fingerprints(DBusGProxy *dev, const char *username) g_print("ListEnrolledFingers failed: %s\n", error->message); exit (1); } else { + g_clear_error (&error); fingers = NULL; } }