X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fhashmap.c;h=51f00131f46f36d632b8ad159549a0dde57a25de;hp=a59b880dffb25bb587f56714cbc03fb75cd2a7ee;hb=449ddb2d23a63ca4c8cd70d13a070fba87c1fb30;hpb=8fe914ec81d9f57bcc083036f528b00119ed2e3b diff --git a/src/hashmap.c b/src/hashmap.c index a59b880df..51f00131f 100644 --- a/src/hashmap.c +++ b/src/hashmap.c @@ -1,4 +1,4 @@ -/*-*- Mode: C; c-basic-offset: 8 -*-*/ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ /*** This file is part of systemd. @@ -173,6 +173,15 @@ void hashmap_free(Hashmap*h) { free(h); } +void hashmap_free_free(Hashmap *h) { + void *p; + + while ((p = hashmap_steal_first(h))) + free(p); + + hashmap_free(h); +} + void hashmap_clear(Hashmap *h) { if (!h) return;