HomeFreeBSD

snmp_output_err_resp, snmp_output_resp: allocate `object` using calloc, not

Description

snmp_output_err_resp, snmp_output_resp: allocate object using calloc, not
on the stack

Some of the callers try to determine whether or not object is valid by
testing the value for NULL, which will never be true if it's a stack value,
so in order to be clear and correct down the call stack, use a heap
allocated object.

This also addresses a Coverity issue by initializing all of object via
calloc

MFC after: 1 week
Reported by: Coverity
CID: 1006392

Details

Provenance
ngieAuthored on
Parents
rS310986: snmp_output_resp: style(9): sort variables by alignment
Branches
Unknown
Tags
Unknown