Fix use-after-free.

Reported by:	Coverity Scan, pfg
CID:		1245747
This commit is contained in:
Alexander V. Chernikov 2015-04-19 12:49:30 +00:00
parent afdfc9a40d
commit 0577d6e0d5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=281740

View File

@ -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);
}