]> git.proxmox.com Git - mirror_qemu.git/blobdiff - util/envlist.c
Use g_new() & friends where that makes obvious sense
[mirror_qemu.git] / util / envlist.c
index 2bcc13f09415484edeca0edf3633e063fea51936..ab5553498ad1b10101941aedb992ce5dd64db7d4 100644 (file)
@@ -217,7 +217,7 @@ envlist_to_environ(const envlist_t *envlist, size_t *count)
        struct envlist_entry *entry;
        char **env, **penv;
 
-       penv = env = g_malloc((envlist->el_count + 1) * sizeof(char *));
+       penv = env = g_new(char *, envlist->el_count + 1);
 
        for (entry = envlist->el_entries.lh_first; entry != NULL;
            entry = entry->ev_link.le_next) {