diff --git a/src/core/snmp/msg_in.c b/src/core/snmp/msg_in.c index 662deec9..3a64909d 100644 --- a/src/core/snmp/msg_in.c +++ b/src/core/snmp/msg_in.c @@ -110,6 +110,11 @@ snmp_error_response(struct snmp_msg_pstat *msg_ps, u8_t error) struct snmp_varbind *vbi = msg_ps->invb.head; struct snmp_varbind *vbo = msg_ps->outvb.head; for (v=0; vvb_idx; v++) { + if (vbi->ident != NULL ) + { + memp_free(MEMP_SNMP_VALUE, vbi->ident); + } + vbi->ident_len = vbo->ident_len; vbo->ident_len = 0; vbi->ident = vbo->ident;