plist_write_to_stream uses the plist_to_x series of functions (plist_to_bin, plist_to_xml, plist_to_json, plist_to_openstep) to conveniently support multiple types.
Problem is, these functions place the burden of freeing the allocated buffer on the callee, which plist_write_to_stream does not do, as such this causes a memory leak the size of the plist written to the specific stream.
The fix is quite simple, the output buffer has to be freed after the fwrite call.
plist_write_to_stream
uses the plist_to_x series of functions (plist_to_bin
,plist_to_xml
,plist_to_json
,plist_to_openstep
) to conveniently support multiple types.Problem is, these functions place the burden of freeing the allocated buffer on the callee, which
plist_write_to_stream
does not do, as such this causes a memory leak the size of the plist written to the specific stream.The fix is quite simple, the output buffer has to be freed after the
fwrite
call.