[PATCH 4/4] lib/open: free GKeyFile

Subject: [PATCH 4/4] lib/open: free GKeyFile

Date: Sat, 6 Mar 2021 09:49:34 -0400

To: notmuch@notmuchmail.org

Cc: David Bremner

From: David Bremner


This fixes a small-to-medium (depending on size of config file) memory
leak.
---
 lib/open.cc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/open.cc b/lib/open.cc
index b424fa0c..a5211746 100644
--- a/lib/open.cc
+++ b/lib/open.cc
@@ -372,6 +372,9 @@ notmuch_database_open_with_config (const char *database_path,
   DONE:
     talloc_free (local);
 
+    if (key_file)
+	g_key_file_free (key_file);
+
     if (message) {
 	if (status_string)
 	    *status_string = message;
@@ -488,6 +491,9 @@ notmuch_database_create_with_config (const char *database_path,
   DONE:
     talloc_free (local);
 
+    if (key_file)
+	g_key_file_free (key_file);
+
     if (message) {
 	if (status_string)
 	    *status_string = message;
-- 
2.30.1
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: