[xml] FW: Some more memleak fixes in Parser.c



 

 

 

 

 

Oops, forgot to attach the patch!!! Sorry

Hi,

   I am attaching a patch for memleak in InputPush function in case realloc fails. realloc was being done on the original pointer, and inputstream was not being freed in case of failure. Also returning from functions calling xmlPushInput if memory failure has occurred (Not sure whther this is required in all cases).

 

Another query is for a lot of places where Inputpush function is invoked the return value is not checked, from what I could make out this is because at the time of context creation the number of input streams is set to 5, and since push is being called directly afterwards, the number of streams will not be more than 5 and thus the realloc block inside inputPush will not be hit. So perhaps that is why memory failure is not expected in those paths.

 

Regards

Ashwin

   

 

 

 

 

 

Attachment: parserpatch.txt
Description: Text document



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]