[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] [PATCH] Fix possible memory leaks with debugging turned on.



On Mon, Aug 15, 2011 at 7:10 AM, Leonid Evdokimov <leon@xxxxxxxxxxxx> wrote:
> I think, I've found couple of memory leaks in libevent debugging code:
> the event was not properly unregistered from debug hashtable.

Good catch here; thanks!

> I run evdns-example using $(valgrind --leak-check=full
> --show-reachable=yes), I'm attaching three valgrind logs:
>
> evdns-example.no-0004.no-0005.log - without 0004-*.patch
> evdns-example.yes-0004.no-0005.log - only 0004-*.patch was applied
> evdns-example.yes-0004.yes-0005.log - both 0004-*.patch and
> 0005-*.patch were applied
>
> Probably, the leaks are not real leaks but my misunderstanding of
> debugging code, so review the patches, please :)

They look okay to me; merged.

> Also, feel free to include evdns-example.c as sample of proper evdns
> cleanup if you find it useful. I think, that cleanup is not trivial.

Hm. I'd like to have something about dns usage in the samples code,
but this one really only covers the variants of cancelling requests or
calling evdns_base_free().  It's important stuff, but it doesn't
really qualify as a generalized "how do I use evdns" example, which is
what I think most people would be looking for.

(as a sidenote, remember that in C, "void foo(void)" takes no
arguments, "void foo()" takes an unspecified number of arguments.)

-- 
Nick
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.