poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/4] src/pk-editor (pk_cmd_editor): Fix memory leak


From: John Darrington
Subject: [PATCH 2/4] src/pk-editor (pk_cmd_editor): Fix memory leak
Date: Sat, 9 Nov 2019 18:10:39 +0100

---
 src/pk-editor.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/pk-editor.c b/src/pk-editor.c
index df910f0..cf811c7 100644
--- a/src/pk-editor.c
+++ b/src/pk-editor.c
@@ -67,8 +67,10 @@ pk_cmd_editor (int argc, struct pk_cmd_arg argv[], uint64_t 
uflags)
       pk_puts ("error: ");
       pk_term_end_class ("error");
       pk_puts ("executing editor.\n");
+      free (cmdline);
       return 0;
     }
+  free (cmdline);
 
   /* If the editor returned success and a file got created, read the
      contents of the file, turn newlines into spaces and execute
-- 
2.11.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]