This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Clean up check_pf allocation pattern. addresses
- From: Andreas Schwab <schwab at suse dot de>
- To: OndÅej BÃlka <neleai at seznam dot cz>
- Cc: libc-alpha at sourceware dot org
- Date: Wed, 26 Mar 2014 10:53:17 +0100
- Subject: Re: [PATCH] Clean up check_pf allocation pattern. addresses
- Authentication-results: sourceware.org; auth=none
- References: <mvm61n3puag dot fsf at hawking dot suse dot de> <20140324165711 dot GA6719 at domone dot podge> <87k3bjzcpb dot fsf at igel dot home> <20140325214344 dot GA23074 at domone dot podge>
OndÅej BÃlka <neleai@seznam.cz> writes:
> diff --git a/sysdeps/unix/sysv/linux/check_pf.c b/sysdeps/unix/sysv/linux/check_pf.c
> index e6a12ed..40b1af2 100644
> --- a/sysdeps/unix/sysv/linux/check_pf.c
> +++ b/sysdeps/unix/sysv/linux/check_pf.c
> @@ -106,6 +106,12 @@ cache_valid_p (void)
> static struct cached_data *
> make_request (int fd, pid_t pid)
> {
> +
Extra empty line.
> @@ -241,40 +230,36 @@ make_request (int fd, pid_t pid)
> }
> }
>
> - struct in6ailist *newp;
> - if (__libc_use_alloca (alloca_used + sizeof (*newp)))
> + if (result_len == 0 || result_len == result_cap)
> {
> - newp = alloca_account (sizeof (*newp), alloca_used);
> - newp->use_malloc = false;
> + result_cap = 2 * result_cap;
> + result = realloc (result, sizeof (*result)
> + + result_cap * sizeof (struct in6addrinfo));
Wrong indent.
> + info->flags = (((ifam->ifa_flags
> & (IFA_F_DEPRECATED
Wrong indent.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."