diff options
author | Volker Lendecke <vl@samba.org> | 2011-07-15 08:20:12 +0200 |
---|---|---|
committer | Volker Lendecke <vlendec@samba.org> | 2011-07-15 09:44:05 +0200 |
commit | 70da27838bb3f6ed9c36add06ce0ccdf467ab1c3 (patch) | |
tree | faf5a7eaddc0b6bb4b167b600ec67f605ddd16e9 /source3 | |
parent | 5049e3e142977a4c3d0f5a0fd9c06429f4d85bed (diff) | |
download | samba-70da27838bb3f6ed9c36add06ce0ccdf467ab1c3.tar.gz samba-70da27838bb3f6ed9c36add06ce0ccdf467ab1c3.tar.bz2 samba-70da27838bb3f6ed9c36add06ce0ccdf467ab1c3.zip |
s3: Avoid leaking http_timestring in print_registry_key
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Fri Jul 15 09:44:05 CEST 2011 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r-- | source3/utils/net_registry_util.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/source3/utils/net_registry_util.c b/source3/utils/net_registry_util.c index 084378f792..22cb3a55b1 100644 --- a/source3/utils/net_registry_util.c +++ b/source3/utils/net_registry_util.c @@ -27,12 +27,20 @@ void print_registry_key(const char *keyname, NTTIME *modtime) { + const char *ts = _("None"); + char *freeme = NULL; + + if (modtime != 0) { + freeme = http_timestring(talloc_tos(), + nt_time_to_unix(*modtime)); + ts = freeme; + } + d_printf(_("Keyname = %s\n"), keyname); - d_printf(_("Modtime = %s\n"), - modtime - ? http_timestring(talloc_tos(), nt_time_to_unix(*modtime)) - : _("None")); + d_printf(_("Modtime = %s\n"), ts); d_printf("\n"); + + TALLOC_FREE(freeme); } void print_registry_value(const struct registry_value *valvalue, bool raw) |