mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-06 09:56:38 +00:00
snmp: Fix a memory leak
Check the value of vbi->ident before replacing it with vbo->ident.
This commit is contained in:
parent
3c40d93f36
commit
0a8c53575c
@ -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 *vbi = msg_ps->invb.head;
|
||||||
struct snmp_varbind *vbo = msg_ps->outvb.head;
|
struct snmp_varbind *vbo = msg_ps->outvb.head;
|
||||||
for (v=0; v<msg_ps->vb_idx; v++) {
|
for (v=0; v<msg_ps->vb_idx; v++) {
|
||||||
|
if (vbi->ident != NULL )
|
||||||
|
{
|
||||||
|
memp_free(MEMP_SNMP_VALUE, vbi->ident);
|
||||||
|
}
|
||||||
|
|
||||||
vbi->ident_len = vbo->ident_len;
|
vbi->ident_len = vbo->ident_len;
|
||||||
vbo->ident_len = 0;
|
vbo->ident_len = 0;
|
||||||
vbi->ident = vbo->ident;
|
vbi->ident = vbo->ident;
|
||||||
|
Loading…
Reference in New Issue
Block a user