On Wed, 27 Oct 2021 17:14:28 +0100, Martijn van Duren wrote: > Trying to search for memory leaks in my new snmpd code I found some > harmless, but annoying ones in system from SNMPv2-MIB. > > We call uname(3) every time (even if we don't even need info from > that call) and ones set we save it until forever. > > Diff below calls uname(3) only a single time and if the variables > aren't snmpd.conf I simply rebuild it every time.
It's possible that 256 bytes will not be sufficient. I think you need to make the buffer sizeof(struct utsname) bytes. - todd
