From Clemens Auer:
[obnox/wireshark/wip.git] / tap-h225counter.c
index 2f4b6e3af872810511b831aa3225637657b75d67..5368f65ff0bec85eee2b63fa00b2689364d36171 100644 (file)
@@ -39,7 +39,6 @@
 #include <epan/tap.h>
 #include <epan/stat_cmd_args.h>
 #include "epan/value_string.h"
-#include "register.h"
 #include <epan/dissectors/packet-h225.h>
 
 /* following values represent the size of their valuestring arrays */
@@ -352,21 +351,18 @@ static void
 h225counter_init(const char *optarg, void* userdata _U_)
 {
        h225counter_t *hs;
-       const char *filter=NULL;
        GString *error_string;
 
+       hs = g_malloc(sizeof(h225counter_t));
        if(!strncmp(optarg,"h225,counter,",13)){
-               filter=optarg+13;
+               hs->filter=g_strdup(optarg+13);
        } else {
-               filter="";
+               hs->filter=NULL;
        }
 
-       hs = g_malloc(sizeof(h225counter_t));
-       hs->filter=g_strdup(filter);
-
        h225counter_reset(hs);
 
-       error_string=register_tap_listener("h225", hs, filter, NULL, h225counter_packet, h225counter_draw);
+       error_string=register_tap_listener("h225", hs, hs->filter, 0, NULL, h225counter_packet, h225counter_draw);
        if(error_string){
                /* error, we failed to attach to the tap. clean up */
                g_free(hs->filter);