On 16 December 2011 08:07, Jun Koi <junkoi2...@gmail.com> wrote:
> This patch replaces all the strdup() with g_strdup()

I don't think you can do this as a pure search-and-replace.
For example this change:
> --- a/envlist.c
> +++ b/envlist.c
> @@ -109,7 +109,7 @@ envlist_parse(envlist_t *envlist, const char *env,
>        * We need to make temporary copy of the env string
>        * as strtok_r(3) modifies it while it tokenizes.
>        */
> -     if ((tmpenv = strdup(env)) == NULL)
> +     if ((tmpenv = g_strdup(env)) == NULL)
>               return (errno);
>
>       envvar = strtok_r(tmpenv, ",", &envsave);

means we're allocating memory with g_strdup but freeing it with
plain free rather than g_free.

You have to take each usage of memory, look for all the places which
allocate/free/strdup it, and change them all at once.

-- PMM

Reply via email to