Send inn-workers mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.isc.org/mailman/listinfo/inn-workers
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of inn-workers digest..."
Today's Topics:
1. Re: Potential Memory Leak in inn-2.6.0/lib/getaddrinfo.c
(Russ Allbery)
----------------------------------------------------------------------
Message: 1
Date: Wed, 14 Oct 2015 12:08:52 -0700
From: Russ Allbery <[email protected]>
To: Bill Parker <[email protected]>
Cc: [email protected]
Subject: Re: Potential Memory Leak in inn-2.6.0/lib/getaddrinfo.c
Message-ID: <[email protected]>
Content-Type: text/plain
Bill Parker <[email protected]> writes:
> In reviewing source code in inn-2.6.0, I found a call to strdup()
> in file 'getaddrinfo.c', which upon failure does not release the
> memory previously allocated to variable 'sin' via calloc(). The
> patch file below should address/correct this issue:
> --- getaddrinfo.c.orig 2015-10-12 18:34:50.194535147 -0700
> +++ getaddrinfo.c 2015-10-12 18:36:00.409459103 -0700
> @@ -217,6 +217,7 @@
> else {
> ai->ai_canonname = strdup(canonical);
> if (ai->ai_canonname == NULL) {
> + free(sin);
> freeaddrinfo(ai);
> return NULL;
> }
Hi Bill,
sin is stored in the ai struct a few lines previous:
ai->ai_addr = (struct sockaddr *) sin;
and therefore will be freed by freeaddrinfo(ai).
--
Russ Allbery ([email protected]) <http://www.eyrie.org/~eagle/>
------------------------------
_______________________________________________
inn-workers mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/inn-workers
End of inn-workers Digest, Vol 77, Issue 2
******************************************