Subject: Re: [PATCH] ares_free_hostent(NULL) should be a noop

Re: [PATCH] ares_free_hostent(NULL) should be a noop

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 13 Jun 2011 22:48:27 +0200 (CEST)

On Mon, 13 Jun 2011, Jakub Hrozek wrote:

> Currently, ares_free_hostent(NULL) would crash as it dereferences the "host"
> parameter unconditionally. I think that the function should just quit when
> passed NULL, similar to what most free functions do.
>
> The most important rationale being that it simplifies cleanup as you can
> just initialize pointers to NULL at declaration time and at cleanup, just
> free them all.

Thanks, applied (but I added a newline as I think it follows our general code
style better).

-- 
  / daniel.haxx.se
Received on 2011-06-13