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

[PATCH] ares_free_hostent(NULL) should be a noop

From: Jakub Hrozek <jhrozek_at_redhat.com>
Date: Mon, 13 Jun 2011 18:32:04 +0200

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.

        Jakub

Received on 2011-06-13