[xml] Correction for Tutorial Code



So I was looking at the Tutorial Code (http://www.xmlsoft.org/tutorial/index.html) and saw that it leaks memory. I was wondering if this could be fixed as it is entirely non-clear to first time users of libxml as to what the semantics of functions like xmlNodeListGetString() are. The sample code (eg http://www.xmlsoft.org/tutorial/apb.html) makes it look like the function simply returns a pointer to a string.

However you need to go through the API to find out that the function actually allocates memory that the caller needs to free. I would appreciate it if an xmlFree() was put in there. The same applies for calls such as xmlGetProp().

Thanks,
Niraj

http://www.andrew.cmu.edu/~ntolia


_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963




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