Re: Memory problems with g_list_append()
- From: Paul Davis <pbd Op Net>
- To: Jeff Shipman - SysProg <jeff nmt edu>
- Cc: gtk-list gtk org
- Subject: Re: Memory problems with g_list_append()
- Date: Tue, 29 Jan 2002 16:42:39 -0500
> 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]