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 #undef ERROUT
DIOCCHANGEADDR_error: DIOCCHANGEADDR_error:
if (newpa->kif) if (newpa != NULL) {
pfi_kif_unref(newpa->kif); if (newpa->kif)
PF_RULES_WUNLOCK(); pfi_kif_unref(newpa->kif);
if (newpa != NULL)
free(newpa, M_PFRULE); free(newpa, M_PFRULE);
}
PF_RULES_WUNLOCK();
if (kif != NULL) if (kif != NULL)
free(kif, PFI_MTYPE); free(kif, PFI_MTYPE);
break; break;