[Axl] axl_doc_parse_from_file aborts program in subfunction

Francis Brosnan Blazquez francis at aspl.es
Mon Feb 17 19:41:52 CET 2014


Hi Raphael,

>   //release axl objects
>      axl_node_free(node);
>      axl_node_free(root);
>      axl_error_free(error);
>      axl_doc_free(doc); 

Here, you only have to call to:

axl_doc_free (doc);

The first to calls to axl_node_free aren't required (they are messing
the memory) because they are internal references to the document you are
about to release on the last statement (axl_doc_free).

The axl_error_free is not required because you didn't get any error.

I've updated axl_doc_get_root, axl_node_get_child_called and
axl_node_get_first_child documentation to warn about this..

..but in general, you only have to release what you have created. I
mean, if you create/load a document (axl_doc_create or
axl_doc_parse_from_file) then you have a corresponding axl_doc_free()
call).

The rest of functions that provides access to the document loaded reuses
references to the entire structure already loaded...so they don't
involve a memory deallocation operation you have to care of.

If you find yourself calling axl_node_free it is because you have
created the node (axl_node_create, axl_node_parse, axl_node_copy).
Otherwise, do you call axl_node_free.

..you can remove all axl_node_free calls done in the rest of your code.

Let us to know if this fixes your issues,
Best Regards,


-- 
Francis Brosnan Blázquez <francis.brosnan at aspl.es>
ASPL
91 134 14 22 - 91 134 14 45 - 91 116 07 57

AVISO LEGAL

Este mensaje se dirige exclusivamente a su destinatario. Los datos
incluidos en el presente correo son confidenciales y sometidos a secreto
profesional, se prohíbe divulgarlos, en virtud de las leyes vigentes. Si
usted no lo es y lo ha recibido por error o tiene conocimiento del mismo
por cualquier motivo, le rogamos que nos lo comunique por este medio y
proceda a destruirlo o borrarlo.

En virtud de lo dispuesto en la Ley Orgánica 15/1999, de 13 de
diciembre, de Protección de Datos de Carácter Personal, le informamos de
que sus datos de carácter personal, recogidos de fuentes accesibles al
público o datos que usted nos ha facilitado previamente, proceden de
bases de datos propiedad de Advanced Software Production Line, S.L.
(ASPL). No obstante, usted puede ejercitar sus derechos de acceso,
rectificación, cancelación y oposición dispuestos en la mencionada Ley
Orgánica, notificándolo por escrito a:
ASPL - Protección Datos, C/Antonio Suárez 10 A-102, 28802, Alcalá de
Henares (Madrid).



More information about the Axl mailing list