mity / md4c

C Markdown parser. Fast. SAX-like interface. Compliant to CommonMark specification.
MIT License
756 stars 138 forks source link

Double-free error #105

Closed mity closed 4 years ago

mity commented 4 years ago

In e1216da we simplified memory management too much and we have introduced a regressio which results in a possible double free error.

In case of links, we cannot recognize whether we need to free the title string because it may point inside the input buffer, into a tmp. buffer managed by some reference definition or it may have be allocated just for us of we are an inline link and the title is too complex so that it needs to be processed before further use.