aboutsummaryrefslogtreecommitdiffstats
path: root/epan/ftypes
diff options
context:
space:
mode:
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2006-12-23 00:10:49 +0000
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2006-12-23 00:10:49 +0000
commit95c45d29ccc26fe332276f40ad08211f7a4d84a0 (patch)
tree9dd5cef9401e4757ed0042b54a6eedcccc818ccf /epan/ftypes
parent02883e388a390aeead7cfc480948ca4bb4498e60 (diff)
make ipv4 ftype use cheap ep_ memory isntead of slightly less cheap g_ memory
for the temporary storage while parsing git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@20205 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/ftypes')
-rw-r--r--epan/ftypes/ftype-ipv4.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/epan/ftypes/ftype-ipv4.c b/epan/ftypes/ftype-ipv4.c
index 045c9fbf10..bb81272d5e 100644
--- a/epan/ftypes/ftype-ipv4.c
+++ b/epan/ftypes/ftype-ipv4.c
@@ -29,6 +29,7 @@
#include <ftypes-int.h>
#include <epan/ipv4.h>
#include <epan/addr_resolv.h>
+#include <epan/emem.h>
static void
@@ -59,7 +60,7 @@ val_from_unparsed(fvalue_t *fv, char *s, gboolean allow_partial_value _U_, LogFu
if (has_slash) {
/* Make a copy of the string and use strtok() to
* get the address portion. */
- s_copy = g_strdup(s);
+ s_copy = ep_strdup(s);
addr_str = strtok(s_copy, "/");
/* I just checked for slash! I shouldn't get NULL here.
@@ -67,7 +68,6 @@ val_from_unparsed(fvalue_t *fv, char *s, gboolean allow_partial_value _U_, LogFu
if (!addr_str) {
logfunc("Unexpected strtok() error parsing IP address: %s",
s_copy);
- g_free(s_copy);
return FALSE;
}
}
@@ -78,9 +78,6 @@ val_from_unparsed(fvalue_t *fv, char *s, gboolean allow_partial_value _U_, LogFu
if (!get_host_ipaddr(addr_str, &addr)) {
logfunc("\"%s\" is not a valid hostname or IPv4 address.",
addr_str);
- if (has_slash) {
- g_free(s_copy);
- }
return FALSE;
}
@@ -94,13 +91,11 @@ val_from_unparsed(fvalue_t *fv, char *s, gboolean allow_partial_value _U_, LogFu
if (!net_str) {
logfunc("Unexpected strtok() error parsing netmask: %s",
s_copy);
- g_free(s_copy);
return FALSE;
}
/* XXX - this is inefficient */
nmask_fvalue = fvalue_from_unparsed(FT_UINT32, net_str, FALSE, logfunc);
- g_free(s_copy);
if (!nmask_fvalue) {
return FALSE;
}