From: martijn Date: Wed, 15 Nov 2023 13:36:11 +0000 (+0000) Subject: Make sure we allocate the correct size for an appl_agentcap. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=dede7ac896857bda9543835c8f5c3f70489f3519;p=openbsd Make sure we allocate the correct size for an appl_agentcap. OK claudio@ miod@ --- diff --git a/usr.sbin/snmpd/application.c b/usr.sbin/snmpd/application.c index 916fc8dfae1..5e32e3b9534 100644 --- a/usr.sbin/snmpd/application.c +++ b/usr.sbin/snmpd/application.c @@ -1,4 +1,4 @@ -/* $OpenBSD: application.c,v 1.37 2023/11/13 10:14:29 martijn Exp $ */ +/* $OpenBSD: application.c,v 1.38 2023/11/15 13:36:11 martijn Exp $ */ /* * Copyright (c) 2021 Martijn van Duren @@ -257,7 +257,7 @@ appl_addagentcaps(const char *ctxname, struct ber_oid *oid, const char *descr, return APPL_ERROR_UNSUPPORTEDCONTEXT; } - if ((cap = malloc(sizeof(*ctx))) == NULL) { + if ((cap = malloc(sizeof(*cap))) == NULL) { log_warn("%s: Can't add agent capabilities %s", backend->ab_name, oidbuf); return APPL_ERROR_PROCESSINGERROR;