Fix potential NULL deref.

Found by:	PVS Studio
This commit is contained in:
glebius 2017-04-14 01:56:15 +00:00
parent eceeea64cb
commit 3bd2cbf9a3

View File

@ -2428,11 +2428,12 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td
#undef ERROUT
DIOCCHANGEADDR_error:
if (newpa->kif)
pfi_kif_unref(newpa->kif);
PF_RULES_WUNLOCK();
if (newpa != NULL)
if (newpa != NULL) {
if (newpa->kif)
pfi_kif_unref(newpa->kif);
free(newpa, M_PFRULE);
}
PF_RULES_WUNLOCK();
if (kif != NULL)
free(kif, PFI_MTYPE);
break;