Hi On Wed, Aug 26, 2015 at 8:23 PM, Denis V. Lunev <den-li...@parallels.com> wrote: > I think that this side effect is visible if the code remains in place > and becomes invisible since you move it to the function. > This could create problem if somebody will reuse this call.
what about replacing it with: static GList *split_list(gchar *str, const gchar *delim) { GList *list = NULL; int i; gchar **strv; strv = g_strsplit(str, delim, -1); for (i = 0; strv[i]; i++) { list = g_list_prepend(list, strv[i]); } g_free(strv); return list; } would that work for you? the list must then be g_list_free_full() -- Marc-André Lureau