[systemd-devel] [PATCH 2/4] bus: driverd: don't remove twice a match from the list

Marc-Antoine Perennou Marc-Antoine at Perennou.com
Fri Dec 27 20:54:17 PST 2013


match_free already does it
---
 src/bus-driverd/bus-driverd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/bus-driverd/bus-driverd.c b/src/bus-driverd/bus-driverd.c
index 44172c4..b423420 100644
--- a/src/bus-driverd/bus-driverd.c
+++ b/src/bus-driverd/bus-driverd.c
@@ -129,10 +129,8 @@ static int match_new(Client *c, struct bus_match_component *components, unsigned
         first = hashmap_get(c->matches, m->match);
         LIST_PREPEND(matches, first, m);
         r = hashmap_replace(c->matches, m->match, first);
-        if (r < 0) {
-                LIST_REMOVE(matches, first, m);
+        if (r < 0)
                 goto fail;
-        }
 
         m->client = c;
         c->n_matches++;
-- 
1.8.5.2



More information about the systemd-devel mailing list