diff options
Diffstat (limited to 'epan/ftypes/ftype-time.c')
-rw-r--r-- | epan/ftypes/ftype-time.c | 17 |
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 |