Skip to contentSkip to conversation

lib-decompress_unxz-make-it-obvious-that-there-is-no-memory-leak.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Oct 7

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: lib: decompress_unxz: make it obvious that there is no memory leak
has been removed from the -mm tree. Its filename was
lib-decompress_unxz-make-it-obvious-that-there-is-no-memory-leak.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Ivy Lopez <[email protected]>
Subject: lib: decompress_unxz: make it obvious that there is no memory leak
Date: Mon, 31 Aug 2026 19:41:38 -0600

Calling __decompress() or unxz() with fill == NULL && flush == NULL && in == NULL is invalid, thus there were no memory leaks even though it might have looked like that. Move the conditional free() calls so that it's obvious that there are no leaks.

---

 lib/decompress_unxz.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
lib/decompress_unxz.c renamed from lib/decompress_unxz.c~lib-decompress_unxz-make-it-obvious-that-there-is-no-memory-leak +5 -5
@@ -342,13 +342,13 @@ STATIC int INIT unxz(unsigned char *in,
 				b.out_pos = 0;
 			}
 		} while (ret == XZ_OK);
+	}
 
-		if (must_free_in)
-			free(in);
+	if (must_free_in)
+		free(in);
 
-		if (flush != NULL)
-			free(b.out);
-	}
+	if (flush != NULL)
+		free(b.out);
 
 	if (in_used != NULL)
 		*in_used += b.in_pos;

_

Patches currently in -mm which might be from [email protected] are