514703: [MC5.3]The snmpd terminated abnormally Don't free and then memcpy prev_vals->old_stats! Checked-in upstream as SVN rev. 17714 diff -up net-snmp-5.3.2.2/agent/mibgroup/ip-mib/data_access/systemstats_common.c.orig2 net-snmp-5.3.2.2/agent/mibgroup/ip-mib/data_access/systemstats_common.c --- net-snmp-5.3.2.2/agent/mibgroup/ip-mib/data_access/systemstats_common.c.orig2 2009-08-04 10:28:49.000000000 +0200 +++ net-snmp-5.3.2.2/agent/mibgroup/ip-mib/data_access/systemstats_common.c 2009-08-04 10:24:30.000000000 +0200 @@ -421,13 +421,13 @@ netsnmp_access_systemstats_entry_update_ */ if (0 == need_wrap_check) { SNMP_FREE(prev_vals->old_stats); + } else { + /* + * update old stats from new stats. + * careful - old_stats is a pointer to stats... + */ + memcpy(prev_vals->old_stats, &new_vals->stats, sizeof(new_vals->stats)); } - - /* - * update old stats from new stats. - * careful - old_stats is a pointer to stats... - */ - memcpy(prev_vals->old_stats, &new_vals->stats, sizeof(new_vals->stats)); _calculate_entries(prev_vals);