Blame SOURCES/libtar-1.2.20-CVE-2021-33645-CVE-2021-33646.patch

70160e
From 78e95da690556874baac96dd1d655e577c6d8e95 Mon Sep 17 00:00:00 2001
70160e
From: Kamil Dudka <kdudka@redhat.com>
70160e
Date: Tue, 4 Oct 2022 10:39:35 +0200
70160e
Subject: [PATCH] free memory allocated by gnu_long* fields
70160e
70160e
---
70160e
 lib/handle.c | 7 +++++--
70160e
 1 file changed, 5 insertions(+), 2 deletions(-)
70160e
70160e
diff --git a/lib/handle.c b/lib/handle.c
70160e
index 28a7dc2..18bd8dc 100644
70160e
--- a/lib/handle.c
70160e
+++ b/lib/handle.c
70160e
@@ -122,8 +122,11 @@ tar_close(TAR *t)
70160e
 		libtar_hash_free(t->h, ((t->oflags & O_ACCMODE) == O_RDONLY
70160e
 					? free
70160e
 					: (libtar_freefunc_t)tar_dev_free));
70160e
-	if (t->th_pathname != NULL)
70160e
-		free(t->th_pathname);
70160e
+
70160e
+	free(t->th_pathname);
70160e
+	free(t->th_buf.gnu_longname);
70160e
+	free(t->th_buf.gnu_longlink);
70160e
+
70160e
 	free(t);
70160e
 
70160e
 	return i;
70160e
-- 
70160e
2.38.1
70160e