aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dfilter/dfilter-int.h
diff options
context:
space:
mode:
authorJoão Valverde <j@v6e.pt>2021-10-14 12:56:57 +0100
committerJoão Valverde <j@v6e.pt>2021-10-14 16:49:23 +0100
commit0d3bfedfb0fa3afd3d7787873823b80796097003 (patch)
tree7c45b081ba5f804feaa7c31f6a4af626bd660f52 /epan/dfilter/dfilter-int.h
parente91b5beafdeb8a2a1366e802fee2c2a3e346b054 (diff)
dfilter: Fixup deprecated tokens initialization
Always use the internal API to access "deprecated" and initialize the data structure on demand. This fixes a null pointer dereference introduced previously. Use reference counting to share the array cleanly and avoid memory leaks. Keep the pointer in dfwork_t.
Diffstat (limited to 'epan/dfilter/dfilter-int.h')
-rw-r--r--epan/dfilter/dfilter-int.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/epan/dfilter/dfilter-int.h b/epan/dfilter/dfilter-int.h
index eff2946d98..9e6cef482c 100644
--- a/epan/dfilter/dfilter-int.h
+++ b/epan/dfilter/dfilter-int.h
@@ -53,7 +53,6 @@ typedef struct {
GString* quoted_string;
gboolean raw_string;
gboolean in_set; /* true if parsing set elements for the membership operator */
- GPtrArray *deprecated;
} df_scanner_state_t;
/* Constructor/Destructor prototypes for Lemon Parser */
@@ -76,7 +75,7 @@ void
dfilter_parse_fail(dfwork_t *dfw, const char *format, ...) G_GNUC_PRINTF(2, 3);
void
-add_deprecated_token(GPtrArray *deprecated, const char *token);
+add_deprecated_token(dfwork_t *dfw, const char *token);
void
free_deprecated(GPtrArray *deprecated);