[splint-discuss] [Beginner] Glib data structures not detected as freed

Stephane Bortzmeyer bortz at users.sourceforge.net
Tue Jan 13 14:00:14 PST 2009


When I run splint on programs using Glib data structures
<http://library.gnome.org/devel/glib/stable/glib-data-types.html>, I
get these sort of warnings:

test-glib-splint.c:29:5: Fresh storage list (type GList *) not released before
    assignment: list = g_list_delete_link(list, g_list_last(list))
   test-glib-splint.c:26:5: Fresh storage list created

The offending line is:

    list = g_list_delete_link(list, g_list_last(list));

I think it is normal Glib idiom. According to the documentation,
g_list_delete_link() frees the removed element (here, at the end of
the list). But how to explain it to splint?

I noticed in the manual the use of /*@releases X@*/ but I did not
write glib and I prefer not to modify its source. 


More information about the splint-discuss mailing list