aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dfilter
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-01-13 12:13:45 -0800
committerGuy Harris <guy@alum.mit.edu>2015-01-13 20:20:03 +0000
commitbc23f797296582d5aca5029dd34244de41ff8605 (patch)
treec582e37dbe1f7186d2a8f16e8c6b22ab608b055d /epan/dfilter
parenta988253fef15e6a0ddd05b0fb06e18ccde00082b (diff)
UAT error string pointers should not be const pointers.
UAT error strings are usually allocated by g_strdup() or g_strdup_printf(), and must ultimately be freed by the caller. Make the pointer-to-error-string-pointer arguments to various functions be "char **", not "const char **". Fix cases that finds where a raw string was being used, as that won't work if you try to free it; g_strdup() it instead. Add a missing free of an error string. Remove some no-longer-necessary casts. Remove some unnecessary g_strdup()s (the string being handed to it was already g_malloc()ated). Change some variable declarations to match. Put in XXX comments for some cases where the error string is just freed, without being shown to the user. Change-Id: I40297746a2ef729c56763baeddbb0842386fa0d0 Reviewed-on: https://code.wireshark.org/review/6525 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dfilter')
-rw-r--r--epan/dfilter/dfilter-macro.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/dfilter/dfilter-macro.c b/epan/dfilter/dfilter-macro.c
index 6ed12a5bbe..ed2f245374 100644
--- a/epan/dfilter/dfilter-macro.c
+++ b/epan/dfilter/dfilter-macro.c
@@ -388,7 +388,7 @@ const gchar* dfilter_macro_apply(const gchar* text, const gchar** error) {
return dfilter_macro_apply_recurse(text, 0, error);
}
-static void macro_update(void* mp, const gchar** error) {
+static void macro_update(void* mp, gchar** error) {
dfilter_macro_t* m = (dfilter_macro_t*)mp;
GPtrArray* parts;
GArray* args_pos;
@@ -576,7 +576,7 @@ static void* macro_copy(void* dest, const void* orig, size_t len _U_) {
return d;
}
-static gboolean macro_name_chk(void* r _U_, const char* in_name, guint name_len, const void* u1 _U_, const void* u2 _U_, const char** error) {
+static gboolean macro_name_chk(void* r _U_, const char* in_name, guint name_len, const void* u1 _U_, const void* u2 _U_, char** error) {
guint i;
if (name_len == 0) {