aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-enip.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2005-12-20 18:38:13 +0000
committerAnders Broman <anders.broman@ericsson.com>2005-12-20 18:38:13 +0000
commit5a0d95fa7665bbb6045ae028aed8bf852e78b636 (patch)
tree8e22c2ce32b23e3ef9945a481c7474997b414964 /epan/dissectors/packet-enip.c
parent17716d37162161b1de99a072056cbfe7a1c5ce49 (diff)
From jaap Keuter:
Taking a random dissector from the list on the Wiki I picked packet-enip.c. Nothing wrong with this one, I still ememified it. From Bart Braem: packet-mip.c does not have support for all registration denials by the foreign agent, code 77 was left out. The attached patch fixes that. svn path=/trunk/; revision=16868
Diffstat (limited to 'epan/dissectors/packet-enip.c')
-rw-r--r--epan/dissectors/packet-enip.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/epan/dissectors/packet-enip.c b/epan/dissectors/packet-enip.c
index a06e92329b..0347d58184 100644
--- a/epan/dissectors/packet-enip.c
+++ b/epan/dissectors/packet-enip.c
@@ -38,6 +38,7 @@
#include <glib.h>
#include <epan/packet.h>
+#include <epan/emem.h>
#include <prefs.h>
#include "packet-tcp.h"
#include "packet-cip.h"
@@ -226,7 +227,7 @@ add_byte_array_text_to_proto_tree( proto_tree *tree, tvbuff_t *tvb, gint start,
}
tmp = (char *)tvb_get_ptr( tvb, start, tmp_length );
- tmp2 = (char*)g_malloc( tmp2_length );
+ tmp2 = (char *)ep_alloc( tmp2_length );
tmp2start = tmp2;
@@ -246,12 +247,10 @@ add_byte_array_text_to_proto_tree( proto_tree *tree, tvbuff_t *tvb, gint start,
*tmp2++ = '.';
}
- *tmp2 = 0;
+ *tmp2 = '\0';
pi = proto_tree_add_text( tree, tvb, start, length, "%s%s", str, tmp2start );
- g_free( tmp2start );
-
return( pi );
} /* end of add_byte_array_text_to_proto_tree() */