chiark / gitweb /
systemctl: hook up new install logic
[elogind.git] / src / hashmap.c
index 53502576ad8b9773d08a528853ce7c27948c865c..ca83e9338552626db3f7d7770a10110cbaacc510 100644 (file)
@@ -596,16 +596,16 @@ Hashmap *hashmap_copy(Hashmap *h) {
 char **hashmap_get_strv(Hashmap *h) {
         char **sv;
         Iterator it;
-        char *path;
+        char *item;
         int n;
 
-        sv = malloc((h->n_entries+1) * sizeof(char *));
-        if (sv == NULL)
+        sv = new(char*, h->n_entries+1);
+        if (!sv)
                 return NULL;
 
         n = 0;
-        HASHMAP_FOREACH(path, h, it)
-                sv[n++] = path;
+        HASHMAP_FOREACH(item, h, it)
+                sv[n++] = item;
         sv[n] = NULL;
 
         return sv;