On 6/7/2017 4:51 AM, jah wrote:
> ---
> src/util/service.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/util/service.c b/src/util/service.c
> index f63737e56..d195452c9 100644
> --- a/src/util/service.c
> +++ b/src/util/service.c
> @@ -1287,11 +1287,11 @@ setup_service (struct GNUNET_SERVICE_Handle *sh)
> {
> GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR,
> "bind");
> - GNUNET_free (addrs[i++]);
> + GNUNET_free (addrs[i]);
> GNUNET_free (slc);
> continue;
> }
> - GNUNET_free (addrs[i++]);
> + GNUNET_free (addrs[i]);
> GNUNET_CONTAINER_DLL_insert (sh->slc_head,
> sh->slc_tail,
> slc);
> For that matter, it should be possible to GNUNET_free(addrs[i]) unconditionally, before the socket opening check (GCC probably optimizes like that anyway, but why not help it?). More worrying, to me, is the fact that addrs array is "struct sockaddr ***", where each struct is malloced individually and put into an array that is also malloced itself. Maximum possible sockaddr size is known, so why isn't it just a "struct sockaddr **"? -- O< ascii ribbon - stop html email! - www.asciiribbon.org
0x6759BA74.asc
Description: application/pgp-keys
signature.asc
Description: OpenPGP digital signature
_______________________________________________ GNUnet-developers mailing list [email protected] https://lists.gnu.org/mailman/listinfo/gnunet-developers
