sd-event: fix theoretical leak on error in event_make_signal_data
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 25 Dec 2015 21:59:44 +0000 (16:59 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 18 Jan 2016 20:21:28 +0000 (15:21 -0500)
src/libsystemd/sd-event/sd-event.c

index c898ccc..11c7330 100644 (file)
@@ -661,8 +661,10 @@ static int event_make_signal_data(
                 d->priority = priority;
 
                 r = hashmap_put(e->signal_data, &d->priority, d);
-                if (r < 0)
+                if (r < 0) {
+                        free(d);
                         return r;
+                }
 
                 added = true;
         }