Wireshark-dev: Re: [Wireshark-dev] Question regarding emem -> wmem conversion

From: Dario Lombardo <dario.lombardo.ml@xxxxxxxxx>
Date: Fri, 13 Sep 2013 14:14:41 +0200
using wmem_epan_scope() it seems to work. Is it correct to use that scope?


On Fri, Sep 13, 2013 at 1:55 PM, Dario Lombardo <dario.lombardo.ml@xxxxxxxxx> wrote:
I'm trying to address se_alloc() calls. If I change this:

Index: packet-infiniband_sdp.c
===================================================================
--- packet-infiniband_sdp.c (revision 52002)
+++ packet-infiniband_sdp.c (working copy)
@@ -31,6 +31,7 @@
 #include <epan/packet.h>
 #include <epan/prefs.h>
 #include <epan/conversation.h>
+#include <epan/wmem/wmem.h>
 #include <stdlib.h>
 #include <errno.h>
 
@@ -529,8 +530,8 @@
         heur_dissector_add("infiniband.mad.cm.private", dissect_ib_sdp, proto_ib_sdp);
 
         /* allocate enough space in the addresses to store the largest address (a GID) */
-        manual_addr_data[0] = se_alloc(GID_SIZE);
-        manual_addr_data[1] = se_alloc(GID_SIZE);
+        manual_addr_data[0] = wmem_alloc(wmem_file_scope(), GID_SIZE);
+        manual_addr_data[1] = wmem_alloc(wmem_file_scope(), GID_SIZE);
 
         initialized = TRUE;
     }
@@ -567,4 +568,3 @@
 
     }
 }
-

tshark -v crashes. What is wrong with my patch?