Memory leak

icetomcat
Posts:1
Joined:Tue Jul 25, 2017 7:50 pm
Memory leak

Postby icetomcat » Tue Jul 25, 2017 7:58 pm

Hi, I found memory leak when use time out for httpdReadRequest:

Code: Select all

		timeout.tv_sec = 0;
		timeout.tv_usec = 100000;
		
		request = httpdReadRequest(server, &timeout, &result);
patch:
api.c

Code: Select all

		if (timeout != 0 && result == 0)
		{
			/* Timeout */
			*status = 0;
			free(request); // <-- add free
			return(NULL);
		}

david
Hughes Tech Staff
Posts:25
Joined:Mon Feb 13, 2017 4:55 am

Re: Memory leak

Postby david » Wed Jul 26, 2017 12:21 am

Hi icetomcat,

Thanks for the patch. That is indeed a memory leak. We've made that change in the source repo and will include it in the 2.1 code release.


Thanks

David
...