-/* $OpenBSD: parse.y,v 1.22 2024/07/10 16:30:43 yasuoka Exp $ */
+/* $OpenBSD: parse.y,v 1.23 2024/07/13 13:06:47 yasuoka Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
listen : LISTEN ON listen_addr {
struct radiusd_listen *n;
- if ((n = malloc(sizeof(struct radiusd_listen)))
+ if ((n = calloc(1, sizeof(struct radiusd_listen)))
== NULL) {
outofmemory:
yyerror("Out of memory: %s", strerror(errno));
popfile();
if (TAILQ_EMPTY(&conf->listen)) {
- if ((l = malloc(sizeof(struct radiusd_listen))) == NULL) {
+ if ((l = calloc(1, sizeof(struct radiusd_listen))) == NULL) {
log_warn("Out of memory");
return (-1);
}
-/* $OpenBSD: radiusd.c,v 1.46 2024/07/10 16:30:43 yasuoka Exp $ */
+/* $OpenBSD: radiusd.c,v 1.47 2024/07/13 13:06:47 yasuoka Exp $ */
/*
* Copyright (c) 2013, 2023 Internet Initiative Japan Inc.
}
/* Check the request authenticator if accounting */
- if ((req_code == RADIUS_CODE_ACCOUNTING_REQUEST ||
- listn->accounting) && radius_check_accounting_request_authenticator(
- packet, client->secret) != 0) {
+ if (req_code == RADIUS_CODE_ACCOUNTING_REQUEST &&
+ radius_check_accounting_request_authenticator(packet,
+ client->secret) != 0) {
log_warnx("Received %s(code=%d) from %s id=%d: bad request "
"authenticator", radius_code_string(req_code), req_code,
peerstr, req_id);