Skip to content

Fix memory leaks in ValidateSchema #2479

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Fix memory leaks in ValidateSchema #2479

wants to merge 1 commit into from

Conversation

martinhsv
Copy link
Contributor

This pull request addresses the 4th one raised in #2469 .

The main change here is to move the pointers to the three xml api objects to the evaluate function as function-scope stack variables. At each stage in the function where a return may occur, all so-far-relevant xmlSchemaFree functions are called to clean up allocated memory.

Some additional memory leak scenarios have been addressed. For examples (transaction->m_xml->m_data.doc == NULL) and (transaction->m_xml->m_data.well_formed != 1). These two in particular have been dealt with by performing the checks at the beginning of the function.

@martinhsv martinhsv added this to the v3.1.0 milestone Dec 17, 2020
@zimmerle
Copy link
Contributor

Merged! thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants