driverd: fix use-after-free error when maintaining match lists

This commit is contained in:
Lennart Poettering
2014-01-08 23:08:35 +08:00
parent 950f87b7e5
commit f37925e02f
+1 -1
View File
@@ -93,7 +93,7 @@ static void match_free(Match *m) {
first = hashmap_get(m->client->matches, m->match);
LIST_REMOVE(matches, first, m);
if (first)
assert_se(hashmap_replace(m->client->matches, m->match, first) >= 0);
assert_se(hashmap_replace(m->client->matches, first->match, first) >= 0);
else
hashmap_remove(m->client->matches, m->match);