From ab998b90206733f2cd9b009dcdb8e5567834ed3b Mon Sep 17 00:00:00 2001
From: Super User <root@localhost.localdomain>
Date: Mon, 25 Sep 2023 14:32:05 +0800
Subject: [PATCH] backport 0002 CVE-2022-48337

---
 lib-src/etags.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib-src/etags.c b/lib-src/etags.c
index 5d0eed2..5399008 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -1680,6 +1680,8 @@ process_file_name (char *file, language *lang)
           int buf_len = strlen (compr->command) + strlen ("  > ") + strlen (new_real_name) + strlen (new_tmp_name) + 1;
           char *cmd = xmalloc (buf_len);
           snprintf (cmd, buf_len, "%s %s > %s", compr->command, new_real_name, new_tmp_name);
+	  free (new_real_name);
+	  free (new_tmp_name);
 #endif
 	  int tmp_errno;
 	  if (system (cmd) == -1)
-- 
2.41.0

