|
From: SourceForge.net <no...@so...> - 2012-09-08 22:46:39
|
Patches item #3565922, was opened at 2012-09-08 15:46 Message generated for change (Tracker Item Submitted) made by tekkamanendless You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=312694&aid=3565922&group_id=12694 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Doug Manley (tekkamanendless) Assigned to: Nobody/Anonymous (nobody) Summary: memory leak in "unload_all_mibs" Initial Comment: When unloading MIBs (particularly when "snmp_shutdown" is called), the "description" field is never freed, leading to a lot of leaked memory. To tell net-snmp to save the descriptions, set NETSNMP_DS_LIB_SAVE_MIB_DESCRS in this way: netsnmp_ds_set_boolean( NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_SAVE_MIB_DESCRS, 1 ); All that is needed in parse.c is a tiny little "if" statement to clean up descriptions if they're set. --- snmplib/parse.c.original 2012-09-08 18:25:45.925354050 -0400 +++ snmplib/parse.c 2012-09-08 18:26:05.805354558 -0400 @@ -4196,6 +4196,8 @@ free(ptc->descriptor); if (ptc->hint) free(ptc->hint); + if (ptc->description) + free(ptc->description); } memset(tclist, 0, MAXTC * sizeof(struct tc)); ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=312694&aid=3565922&group_id=12694 |