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>] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1202050210060.30244@swampdragon.chaosbits.net>
Date:	Sun, 5 Feb 2012 02:12:18 +0100 (CET)
From:	Jesper Juhl <jj@...osbits.net>
To:	linux-acpi@...r.kernel.org
cc:	linux-kernel@...r.kernel.org, Bob Moore <robert.moore@...el.com>,
	Lin Ming <ming.m.lin@...el.com>, Len Brown <lenb@...nel.org>
Subject: [PATCH] ACPI, psargs: Fix small mem leaks on error paths

As far as I can see, there are two small mem leaks in error paths of
'acpi_ps_get_next_field()' where we neglect to free the memory
previously allocated to 'field'.

I believe this patch should fix the leaks.

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

 Note: Compile tested only.

diff --git a/drivers/acpi/acpica/psargs.c b/drivers/acpi/acpica/psargs.c
index 5ac36ab..a683d66 100644
--- a/drivers/acpi/acpica/psargs.c
+++ b/drivers/acpi/acpica/psargs.c
@@ -618,6 +618,7 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
 
 				arg = acpi_ps_alloc_op(AML_INT_BYTELIST_OP);
 				if (!arg) {
+					acpi_ps_free_op(field);
 					return_PTR(NULL);
 				}
 
@@ -662,6 +663,7 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
 		} else {
 			arg = acpi_ps_alloc_op(AML_INT_NAMEPATH_OP);
 			if (!arg) {
+				acpi_ps_free_op(field);
 				return_PTR(NULL);
 			}
 
-- 
1.7.9


-- 
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