This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Clean up check_pf allocation pattern. addresses


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."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]