diff mbox series

nss: Remove unused allocation from get_nscd_addresses in getaddrinfo

Message ID 87msu71tg1.fsf@oldenburg.str.redhat.com
State New
Headers show
Series nss: Remove unused allocation from get_nscd_addresses in getaddrinfo | expand

Commit Message

Florian Weimer Dec. 18, 2023, 2:22 p.m. UTC
No bug because this is not visible if glibc is built with
optimization.  Otherwise this would be a critical resource leak.

---
Tested on i686-linux-gnu and x86_64-linux-gnu.

nss/getaddrinfo.c | 1 -
 1 file changed, 1 deletion(-)


base-commit: 12ab77e893479a1f7d4666082a48efad79777bb9

Comments

Andreas Schwab Dec. 18, 2023, 2:33 p.m. UTC | #1
On Dez 18 2023, Florian Weimer wrote:

> No bug because this is not visible if glibc is built with
> optimization.  Otherwise this would be a critical resource leak.

Ok.
Carlos O'Donell Dec. 18, 2023, 5:17 p.m. UTC | #2
On 12/18/23 09:22, Florian Weimer wrote:
> No bug because this is not visible if glibc is built with
> optimization.  Otherwise this would be a critical resource leak.

LGTM. I verified that -Os still optimizes away the calloc().

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> ---
> Tested on i686-linux-gnu and x86_64-linux-gnu.
> 
> nss/getaddrinfo.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/nss/getaddrinfo.c b/nss/getaddrinfo.c
> index 531124958d..ce3af931b2 100644
> --- a/nss/getaddrinfo.c
> +++ b/nss/getaddrinfo.c
> @@ -514,7 +514,6 @@ get_nscd_addresses (const char *name, const struct addrinfo *req,
>    int result = 0;
>    char *addrs = air->addrs;
>  
> -  struct gaih_addrtuple *addrfree = calloc (air->naddrs, sizeof (*addrfree));
>    struct gaih_addrtuple *at = calloc (air->naddrs, sizeof (*at));
>    if (at == NULL)
>      {
> 
> base-commit: 12ab77e893479a1f7d4666082a48efad79777bb9
>
diff mbox series

Patch

diff --git a/nss/getaddrinfo.c b/nss/getaddrinfo.c
index 531124958d..ce3af931b2 100644
--- a/nss/getaddrinfo.c
+++ b/nss/getaddrinfo.c
@@ -514,7 +514,6 @@  get_nscd_addresses (const char *name, const struct addrinfo *req,
   int result = 0;
   char *addrs = air->addrs;
 
-  struct gaih_addrtuple *addrfree = calloc (air->naddrs, sizeof (*addrfree));
   struct gaih_addrtuple *at = calloc (air->naddrs, sizeof (*at));
   if (at == NULL)
     {