Re: [Qemu-devel] [Qemu-trivial] [PATCH v2] util: Use g_malloc/g_free in envlist.c

2017-03-16 Thread Stefan Hajnoczi
On Sun, Mar 05, 2017 at 02:56:05AM +, Saurav Sachidanand wrote: > diff --git a/util/envlist.c b/util/envlist.c > index e86857e70a..a42eefa5fe 100644 > --- a/util/envlist.c > +++ b/util/envlist.c > @@ -17,16 +17,14 @@ static int envlist_parse(envlist_t *envlist, > const char *env, int (*)(e

[Qemu-devel] [Qemu-trivial] [PATCH v2] util: Use g_malloc/g_free in envlist.c

2017-03-04 Thread Saurav Sachidanand
Change malloc/free to g_malloc/g_free in util/envlist.c, except for entry->env_var which is allocated using strdup(3). Remove NULL checks for pointers returned from g_malloc as it exits in case of failure. Update calls to envlist_create to reflect this. Free array returned by envlist_to_environ u