From 8cddaa4fab185eca1a472c79aa9de1555eefb04b Mon Sep 17 00:00:00 2001 From: stsp Date: Fri, 13 Aug 2021 13:13:11 +0000 Subject: [PATCH] Plug memory leak in an unlikely error path of iwx_umac_scan_v14(). CID 1506261 --- sys/dev/pci/if_iwx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/if_iwx.c b/sys/dev/pci/if_iwx.c index 4d0042555c2..c3d401c1a0c 100644 --- a/sys/dev/pci/if_iwx.c +++ b/sys/dev/pci/if_iwx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwx.c,v 1.89 2021/08/07 09:21:51 stsp Exp $ */ +/* $OpenBSD: if_iwx.c,v 1.90 2021/08/13 13:13:11 stsp Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh @@ -5989,8 +5989,10 @@ iwx_umac_scan_v14(struct iwx_softc *sc, int bgscan) scan_p->periodic_params.schedule[0].iter_count = 1; err = iwx_fill_probe_req(sc, &scan_p->probe_params.preq); - if (err) + if (err) { + free(cmd, M_DEVBUF, sizeof(*cmd)); return err; + } if (ic->ic_des_esslen != 0) { scan_p->probe_params.direct_scan[0].id = IEEE80211_ELEMID_SSID; -- 2.20.1