aboutsummaryrefslogtreecommitdiffstats
path: root/epan/ftypes/ftype-time.c
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2014-06-15 23:42:14 -0700
committerMichael Mann <mmann78@netscape.net>2014-06-16 17:26:25 +0000
commitde00c49bd84c853c9260f70cc5857c5a5ab6d3be (patch)
treed20495295746d9c1b0623b631931f538ee6d3581 /epan/ftypes/ftype-time.c
parentb71b68cd637de5501de9d5684c79b6c8b5b2dfd3 (diff)
Convert a bunch of time_to_str functions to wmem
Change-Id: I24fe3cc4a3589dadc4528a77fe7ff13d06b1a983 Reviewed-on: https://code.wireshark.org/review/2245 Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/ftypes/ftype-time.c')
-rw-r--r--epan/ftypes/ftype-time.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/epan/ftypes/ftype-time.c b/epan/ftypes/ftype-time.c
index 1ba72a0051..67a669da64 100644
--- a/epan/ftypes/ftype-time.c
+++ b/epan/ftypes/ftype-time.c
@@ -327,18 +327,25 @@ static int
absolute_val_repr_len(fvalue_t *fv, ftrepr_t rtype _U_)
{
gchar *rep;
+ int ret;
- rep = abs_time_to_ep_str(&fv->value.time, ABSOLUTE_TIME_LOCAL,
+ rep = abs_time_to_str(NULL, &fv->value.time, ABSOLUTE_TIME_LOCAL,
rtype == FTREPR_DISPLAY);
- return (int)strlen(rep) + 2; /* 2 for opening and closing quotes */
+
+ ret = (int)strlen(rep) + 2; /* 2 for opening and closing quotes */
+
+ wmem_free(NULL, rep);
+
+ return ret;
}
static void
absolute_val_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf)
{
- sprintf(buf, "\"%s\"",
- abs_time_to_ep_str(&fv->value.time, ABSOLUTE_TIME_LOCAL,
- rtype == FTREPR_DISPLAY));
+ gchar *rep = abs_time_to_str(NULL, &fv->value.time, ABSOLUTE_TIME_LOCAL,
+ rtype == FTREPR_DISPLAY);
+ sprintf(buf, "\"%s\"", rep);
+ wmem_free(NULL, rep);
}
static int