Re: [PATCH] fix memory leak when xmlRegStatePush failed

Nick Wellnhofer via xml <[email protected]> Sat, 13 Mar 2021 19:06:58 +0100
Newsgroups gmane.comp.gnome.lib.xml.general
Message-ID <[email protected]>
On 12/01/2021 10:42, zhuyan (M) wrote:
> 
> In the function xmlRegStatePush, if xmlMalloc or xmlRealloc fails,

Yes, there are many issues that arise from poor handling of malloc failures. 
Fortunately, similar issues can be found quite effectively by changing the 
fuzzers to inject malloc failures. I already started to address these errors 
in a more systematic way, but I want to hold off further commits until after 
the next release.

Note that in this particular case, it is easier to make static function 
xmlRegStatePush free the 'to' state on error.

Nick