lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1201162126510.16712@swampdragon.chaosbits.net>
Date:	Mon, 16 Jan 2012 21:28:37 +0100 (CET)
From:	Jesper Juhl <jj@...osbits.net>
To:	devel@...verdev.osuosl.org
cc:	linux-kernel@...r.kernel.org, Greg Kroah-Hartman <gregkh@...e.de>,
	Forest Bond <forest@...ttletooquiet.net>,
	Joe Perches <joe@...ches.com>,
	Ilia Mirkin <imirkin@...m.mit.edu>,
	Dan Carpenter <dan.carpenter@...cle.com>
Subject: [PATCH 2/2] staging, vt6656/wpactl.c: Fix mem leak in wpa_ioctl()

If we hit the default case in the switch statement in wpa_ioctl()
we'll leak the memory allocated to 'param' when the variable goes out
of scope without having been assigned to anything.

This patch fixes the leak by kfree()'ing the memory before we return
from the function.

Signed-off-by: Jesper Juhl <jj@...osbits.net>
---
 drivers/staging/vt6656/wpactl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/vt6656/wpactl.c b/drivers/staging/vt6656/wpactl.c
index 9d14868..5435e82 100644
--- a/drivers/staging/vt6656/wpactl.c
+++ b/drivers/staging/vt6656/wpactl.c
@@ -902,6 +902,7 @@ int wpa_ioctl(PSDevice pDevice, struct iw_point *p)
 	default:
 		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wpa_ioctl: unknown cmd=%d\n",
 			param->cmd);
+		kfree(param);
 		return -EOPNOTSUPP;
 	}
 
-- 
1.7.8.3


-- 
Jesper Juhl <jj@...osbits.net>       http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ