Re: Memory problems with g_list_append()



>   gchar *shell;
>   GList *shells;
>
>   setusershell();
>   while((shell = getusershell()) != NULL)
>      valid_shells = g_list_append(valid_shells, shell);

you've stored a meaningless pointer in the list. use

       valid_shells = g_list_append (valid_shells, g_strdup (shell));

--p



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]