nss: Remove unused allocation from get_nscd_addresses in getaddrinfo
Checks
Context |
Check |
Description |
redhat-pt-bot/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
linaro-tcwg-bot/tcwg_glibc_build--master-arm |
success
|
Testing passed
|
redhat-pt-bot/TryBot-32bit |
success
|
Build for i686
|
linaro-tcwg-bot/tcwg_glibc_check--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 |
success
|
Testing passed
|
Commit Message
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
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.
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
>
@@ -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)
{