Plug extension list leak.
authorGuy Harris <guy@alum.mit.edu>
Fri, 6 Jul 2018 09:58:06 +0000 (02:58 -0700)
committerGuy Harris <guy@alum.mit.edu>
Fri, 6 Jul 2018 09:58:46 +0000 (09:58 +0000)
Change-Id: Ie3d2d5fb76ca5de2488e270771b94f7374a8838f
Reviewed-on: https://code.wireshark.org/review/28640
Reviewed-by: Guy Harris <guy@alum.mit.edu>
file.c

diff --git a/file.c b/file.c
index a94ecd5eff430421271ed0a7c0cd936b6a39ecd5..54f629b068b6bdf9dd4ee5afc79b7cf9f47c2d9b 100644 (file)
--- a/file.c
+++ b/file.c
@@ -1050,9 +1050,10 @@ cf_get_basename(capture_file *cf)
           strcmp(&displayname[displayname_len - extension_len], extension) == 0) {
             /* Yes.  Strip the extension off, and return the result. */
             displayname[displayname_len - extension_len - 1] = '\0';
-            return displayname;
+            break;
         }
       }
+      wtap_free_extensions_list(extensions);
     } else {
       displayname=g_strdup("");
     }