chiark / gitweb /
Revert "bus: driverd: don't attempt to remove from empty list"
[elogind.git] / src / bus-driverd / bus-driverd.c
index f8a123d4f118d290ae73005648c435f503d5ac35..44172c4ed6a211c38eab21a7b32ed281151b0227 100644 (file)
@@ -90,10 +90,10 @@ static void match_free(Match *m) {
                 Match *first;
 
                 first = hashmap_get(m->client->matches, m->match);
-                if (first) {
-                        LIST_REMOVE(matches, first, m);
+                LIST_REMOVE(matches, first, m);
+                if (first)
                         assert_se(hashmap_replace(m->client->matches, m->match, first) >= 0);
-                else
+                else
                         hashmap_remove(m->client->matches, m->match);
 
                 m->client->n_matches--;