Skip to content
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

Some memory fixes #1004

Merged
merged 3 commits into from
Dec 21, 2016
Merged

Some memory fixes #1004

merged 3 commits into from
Dec 21, 2016

Conversation

vikman90
Copy link
Contributor

@vikman90 vikman90 commented Dec 21, 2016

Hi,

I propose these changes, that should fix three issues detected from previous commits:

  1. PR fix memory leak in decode-xml.c #930 prevents a memory leak by freeing pi structure, but pi->name should be deleted before.

  2. At function 09e9f5b#diff-7c75ce14fc99e77cf2ac6208fbb99946R1233 a string is created and filled but it's not initialized. We'll write the last NULL character and declare the function as returning a constant string.

  3. At PR fix common realloc mistake in custom_output_search_replace.c #931 a test to check that realloc returns a valid pointer is performed, but in case of error, old memory is freed and the loop continues using the variable pointing to an invalid address. os_realloc checks whether memory is available and if it isn't, will make the program to exit.

Best regards.

@ddpbsd ddpbsd merged commit 6e7c6de into ossec:master Dec 21, 2016
@vikman90 vikman90 deleted the memory_fix branch December 21, 2016 19:33
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