mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] unlzo: Fix input buffer free
@ 2011-11-17 21:29 Sascha Hauer
  2011-11-18 17:10 ` Lasse Collin
  0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2011-11-17 21:29 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton, Lasse Collin, Sascha Hauer

unlzo modifies the pointer to in_buf, so we have to free the
original buffer, not the modified pointer. This only happens
when a fill function is passed, a case which is currently unused
in the kernel.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 lib/decompress_unlzo.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/decompress_unlzo.c b/lib/decompress_unlzo.c
index 5a7a2ad..4531294 100644
--- a/lib/decompress_unlzo.c
+++ b/lib/decompress_unlzo.c
@@ -279,7 +279,7 @@ STATIC inline int INIT unlzo(u8 *input, int in_len,
 	ret = 0;
 exit_2:
 	if (!input)
-		free(in_buf);
+		free(in_buf_save);
 exit_1:
 	if (!output)
 		free(out_buf);
-- 
1.7.7.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-18 17:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-17 21:29 [PATCH] unlzo: Fix input buffer free Sascha Hauer
2011-11-18 17:10 ` Lasse Collin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®