Fix memory leak in etags.c
authorEli Zaretskii <eliz@gnu.org>
Sun, 26 Feb 2023 18:03:20 +0000 (20:03 +0200)
committerSean Whitton <spwhitton@spwhitton.name>
Thu, 2 Mar 2023 17:27:20 +0000 (10:27 -0700)
This upstream patch has been incorporated to fix the problem:

  * lib-src/etags.c (process_file_name): Free malloc'ed vars (bug#61819).

Origin: upstream, commit 0fde314f6f6e6664cddab1b2f0fe20629cd39d14
Bug: https://debbugs.gnu.org/61819
Bug-Debian: https://bugs.debian.org/1031888
Forwarded: not-needed

lib-src/etags.c

index a6bd7f66e29ab5e651594baba4d8b6923a1389dc..ea80ba6e49a6ee977bbe4a73c1bb25fde2019e5d 100644 (file)
@@ -1714,6 +1714,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
          inf = (system (cmd) == -1
                 ? NULL