[systemd-devel] [PATCH 1/6] journal: fix memleak, call set_free before return

Michal Sekletar msekleta at redhat.com
Thu Oct 25 07:16:14 PDT 2012


---
 src/journal/coredumpctl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c
index 5c442ff..d15a31e 100644
--- a/src/journal/coredumpctl.c
+++ b/src/journal/coredumpctl.c
@@ -58,6 +58,7 @@ static Set *new_matches(void) {
         if (!tmp) {
                 log_oom();
                 set_clear_free(set);
+                set_free(set);
                 return NULL;
         }
 
@@ -66,6 +67,7 @@ static Set *new_matches(void) {
                 log_error("failed to add to set: %s", strerror(-r));
                 free(tmp);
                 set_clear_free(set);
+                set_free(set);
                 return NULL;
         }
 
-- 
1.7.11.7



More information about the systemd-devel mailing list