Thank you very much for this great explanation !
This code perfectly works for freeing xmlDocPtr but not
for xmlDtdPtr
I created a method to free loaded did (I cannot free just
after the validating because I use it multiple times against
different documents) which do the following :
if(*dtd == NULL){
return;
}
// Force clear memory DTD loaded
xmlFreeDtd(*dtd);
*dtd = nullptr;
It works great! But if I call this functions twice or more
I got an error "3400 segmentation fault" which is not the
expected result ;) .
I did the same for xmLdocPtdr an I can call it's function
twice without error.
I do not understand the real problem :s