snmp_table_fetch_async: don't leak work
if snmp_pdu_send(..) fails
MFC after: 1 week Reported by: Coverity CID: 1017276
This commit is contained in:
parent
994c8618ec
commit
3daec7ae72
@ -728,8 +728,11 @@ snmp_table_fetch_async(const struct snmp_table *descr, void *list,
|
||||
work->last_change = 0;
|
||||
table_init_pdu(descr, &work->pdu);
|
||||
|
||||
if (snmp_pdu_send(&work->pdu, table_cb, work) == -1)
|
||||
if (snmp_pdu_send(&work->pdu, table_cb, work) == -1) {
|
||||
free(work);
|
||||
work = NULL;
|
||||
return (-1);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user