{
LOG (GNUNET_ERROR_TYPE_ERROR,
_("Could not access a pre-bound socket, will try to bind myself\n"));
- for (i = 0; sctx->lsocks[i] != NULL && i < count; i++)
+ for (i = 0; i < count && sctx->lsocks[i] != NULL; i++)
GNUNET_break (0 == GNUNET_NETWORK_socket_close (sctx->lsocks[i]));
- GNUNET_free (sctx->lsocks);
+ GNUNET_free_non_null (sctx->lsocks);
sctx->lsocks = NULL;
return GNUNET_NO;
}