bus: driverd: don't attempt to remove from empty list

This commit is contained in:
Marc-Antoine Perennou 2013-12-28 13:54:18 +09:00 committed by Kay Sievers
parent 3f78871b03
commit 215c7625dd
1 changed files with 3 additions and 3 deletions

View File

@ -90,10 +90,10 @@ static void match_free(Match *m) {
Match *first;
first = hashmap_get(m->client->matches, m->match);
LIST_REMOVE(matches, first, m);
if (first)
if (first) {
LIST_REMOVE(matches, first, m);
assert_se(hashmap_replace(m->client->matches, m->match, first) >= 0);
else
} else
hashmap_remove(m->client->matches, m->match);
m->client->n_matches--;