|
From: SourceForge.net <no...@so...> - 2012-10-24 07:30:40
|
Patches item #3565922, was opened at 2012-09-08 15:46 Message generated for change (Comment added) made by nba 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: Closed Resolution: Accepted Priority: 5 Private: No Submitted By: Doug Manley (tekkamanendless) Assigned to: Niels Baggesen (nba) 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)); ---------------------------------------------------------------------- >Comment By: Niels Baggesen (nba) Date: 2012-10-24 00:30 Message: Actually, it was applied to 5.4.x too :-) ---------------------------------------------------------------------- Comment By: Niels Baggesen (nba) Date: 2012-10-24 00:29 Message: Thanks for the patch! It has been applied to the 5.5.x and later code branches and the main development tree, and will appear in future releases of the Net-SNMP package. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=312694&aid=3565922&group_id=12694 |