aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epan/packet.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/epan/packet.c b/epan/packet.c
index 50b24d7d85..28410f8e0d 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -2841,31 +2841,30 @@ dissector_handle_get_dissector_name(const dissector_handle_t handle)
return handle->name;
}
-/* Create an anonymous handle for a new dissector. */
-dissector_handle_t
-create_dissector_handle(dissector_t dissector, const int proto)
+static dissector_handle_t
+new_dissector_handle(dissector_t dissector, int proto, const char *name)
{
struct dissector_handle *handle;
handle = wmem_new(wmem_epan_scope(), struct dissector_handle);
- handle->name = NULL;
+ handle->name = name;
handle->dissector = dissector;
handle->protocol = find_protocol_by_id(proto);
-
return handle;
}
-dissector_handle_t create_dissector_handle_with_name(dissector_t dissector,
- const int proto, const char* name)
+/* Create an anonymous handle for a new dissector. */
+dissector_handle_t
+create_dissector_handle(dissector_t dissector, const int proto)
{
- struct dissector_handle *handle;
-
- handle = wmem_new(wmem_epan_scope(), struct dissector_handle);
- handle->name = name;
- handle->dissector = dissector;
- handle->protocol = find_protocol_by_id(proto);
+ return new_dissector_handle(dissector, proto, NULL);
+}
- return handle;
+dissector_handle_t
+create_dissector_handle_with_name(dissector_t dissector,
+ const int proto, const char* name)
+{
+ return new_dissector_handle(dissector, proto, name);
}
/* Destroy an anonymous handle for a dissector. */