aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lemon/patches/06-lemon-memleak-template-assumption.patch
blob: c6e3264c2bb8eb16a9a7e0d125b2b91b8b6f5a78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
The memory of pathsearch is leaked by tplt_open. Instead of functionally modify
the code to fix the leak, just assert that we will never reach that code path
since Wireshark always sets the template option.

Not suitable for proposing to upstream since the assumption might not hold!
--- a/lemon.c
+++ b/lemon.c
@@ -3505,6 +3505,9 @@ PRIVATE FILE *tplt_open(struct lemon *lemp)
   char *tpltname;
   char *cp;
 
+  /* We always require the -T option, avoid memleak in the other code path. */
+  assert(user_templatename);
+
   /* first, see if user specified a template filename on the command line. */
   if (user_templatename != 0) {
     if( access(user_templatename,004)==-1 ){