> I do not know internally the list creation api, and maybe I am saying > something wrong, but, Could be possible to always create/reserve the > memory inside pdf_list_create function, so we do not mind the incoming > pointer list? > > Regards. > >
Explaining a little bit deeper, for example glib (I am a glib fan) normally allocates the memory inside the functions and the user has to call the appropriate functions to free them, for example: /* Notice that these are initialized to the empty list. */ GList *list = NULL, *number_list = NULL; /* This is a list of strings. */ list = g_list_append (list, "first"); list = g_list_append (list, "second"); // Do whatever /* Free */ g_list_free(list); http://library.gnome.org/devel/glib/stable/glib-Doubly-Linked-Lists.html#id3511896 "There is no function to create a GList. NULL is considered to be the empty list so you simply set a GList* to NULL." - Eder.
