Page MenuHomeFreeBSD

bsnmpd/snmp_hostres: fix hrFSTable remoteMountPoint leak
ClosedPublic

Authored by oshogbo on Jun 16 2026, 11:27 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 11, 1:15 AM
Unknown Object (File)
Thu, Oct 8, 11:36 PM
Unknown Object (File)
Mon, Oct 5, 3:33 AM
Unknown Object (File)
Mon, Oct 5, 2:58 AM
Unknown Object (File)
Sun, Oct 4, 9:03 AM
Unknown Object (File)
Sun, Oct 4, 5:32 AM
Unknown Object (File)
Sat, Oct 3, 11:20 PM
Unknown Object (File)
Fri, Oct 2, 10:49 PM
Subscribers

Details

Summary

Free the previous value before re-strdup'ing, and initialise
remoteMountPoint to NULL in fs_entry_create() so the free() is safe on
the newly-created path

Observed via a dtrace leak snapshot on 15.0-RELEASE-p4:

data leaked = 1983, count = 1683

libc.so.7`malloc+0xa8
snmp_hostres.so.6`fs_tbl_process_statfs_entry+0x276
snmp_hostres.so.6`refresh_storage_tbl+0x502
snmp_hostres.so.6`op_hrStorageTable+0x1a
libbsnmp.so.7`0x2a2b1892ba3d
libbsnmp.so.7`snmp_getbulk+0x37f

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable