Skip to content

Commit

Permalink
update CHANGELOG and fix coding style (fixed bug #39355 SNMP Memory L…
Browse files Browse the repository at this point in the history
…eak in case of error)
  • Loading branch information
goldsimon committed Sep 3, 2014
1 parent 0a8c535 commit e8f49f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ HISTORY

++ Bugfixes:

2014-09-03: Simon Goldschmidt
* msg_in.c: fixed bug #39355 SNMP Memory Leak in case of error

2014-09-02: Simon Goldschmidt
* err.h/.c, sockets.c, api_msg.c: fixed bug #43110 call getpeername() before
listen() will cause a error
Expand Down
5 changes: 2 additions & 3 deletions src/core/snmp/msg_in.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,10 @@ 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; v<msg_ps->vb_idx; v++) {
if (vbi->ident != NULL )
{
if (vbi->ident != NULL) {
/* free previously allocated value before overwriting the pointer */
memp_free(MEMP_SNMP_VALUE, vbi->ident);
}

vbi->ident_len = vbo->ident_len;
vbo->ident_len = 0;
vbi->ident = vbo->ident;
Expand Down

0 comments on commit e8f49f1

Please sign in to comment.