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

memory leak calling cgi_unescape_special_chars() #3

Closed
LeSpocky opened this issue Oct 23, 2012 · 2 comments
Closed

memory leak calling cgi_unescape_special_chars() #3

LeSpocky opened this issue Oct 23, 2012 · 2 comments

Comments

@LeSpocky
Copy link
Collaborator

The function cgi_unescape_special_chars() allocates some memory based on the length of the input string and returns the pointer to this new allocated memory as output. The function is used twice in LibCGI and in neither case the memory is freed again although not used further.

First is in cgi_get_cookies() where the pointer taking the return argument is overwritten multiple times before the memory can be freed.

Second is in process_data() where the result is directly fed in another function giving you no chance to free it again.

In environments with small memory this leads to problems processing large form data with lots of key/value pairs.

@rafaelsteil
Copy link
Owner

Can you make a patch and pull request? I'll be glad to apply to the main repository. Thanks

@LeSpocky
Copy link
Collaborator Author

On Tue, Oct 23, 2012 at 09:53:39AM -0700, Rafael Steil wrote:

Can you make a patch and pull request? I'll be glad to apply to the main repository. Thanks

I will. I filed this to remind myself what needs to be fixed. ;)

rafaelsteil added a commit that referenced this issue May 7, 2013
quick fix not freed memory reported in #2 and #3
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

No branches or pull requests

2 participants