2017-10-04 14:00 GMT+05:00 Christopher Faulet <cfau...@haproxy.com>: > Le 04/10/2017 à 07:49, Илья Шипицин a écrit : > >> >> >> 2017-10-04 9:15 GMT+05:00 Willy Tarreau <w...@1wt.eu <mailto:w...@1wt.eu>>: >> >> Hi Ilya, >> >> [also CCing Baptiste] >> >> On Tue, Oct 03, 2017 at 05:25:17PM +0500, ???? ??????? wrote: >> > [src/dns.c:2502]: (error) Memory leak: buffer >> > >> > >> > I do not see any "buffer" usage except conditional free. >> > should we just remove "buffer" from there ? >> >> I think you're referring to this part : >> >> struct dns_resolution *dns_alloc_resolution(void) >> { >> struct dns_resolution *resolution = NULL; >> char *buffer = NULL; >> >> resolution = calloc(1, sizeof(*resolution)); >> buffer = calloc(1, global.tune.bufsize); >> >> if (!resolution || !buffer) { >> free(buffer); >> free(resolution); >> return NULL; >> } >> >> LIST_INIT(&resolution->requester.wait); >> LIST_INIT(&resolution->requester.curr); >> >> return resolution; >> } >> >> And there's definitely a memory leak on the allocated buffer. Buffers >> used to be needed for resolution in the past but I think that's no >> longer the case, so I think that indeed the buffer can be completely >> removed (unless it should be assigned somewhere of course). It's >> >> >> great. I'll send a patch today >> >> > Hi, > > I'm working on the DNS part to make it thread-safe. In my patch set, among > other things, I fixed this one. I will send everything to Willy in few > days. So don't bother with it. >
... using ThreadSanitizer from google ? I plan to fix cppcheck/clang issues first, and have a look at sanitizers after that > > Thanks > -- > Christopher Faulet > >