Fix use-after-free.
Reported by: Coverity Scan, pfg CID: 1245747
This commit is contained in:
parent
afdfc9a40d
commit
0577d6e0d5
@ -1008,11 +1008,10 @@ nat_foreach(nat_cb_t *f, void *arg, int sort)
|
||||
|
||||
olh->size = sz;
|
||||
if (do_get3(IP_FW_NAT44_LIST_NAT, &olh->opheader, &sz) != 0) {
|
||||
sz = olh->size;
|
||||
free(olh);
|
||||
if (errno == ENOMEM) {
|
||||
sz = olh->size;
|
||||
if (errno == ENOMEM)
|
||||
continue;
|
||||
}
|
||||
return (errno);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user