summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-07-15 08:20:12 +0200
committerVolker Lendecke <vlendec@samba.org>2011-07-15 09:44:05 +0200
commit70da27838bb3f6ed9c36add06ce0ccdf467ab1c3 (patch)
treefaf5a7eaddc0b6bb4b167b600ec67f605ddd16e9 /source3/utils
parent5049e3e142977a4c3d0f5a0fd9c06429f4d85bed (diff)
downloadsamba-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/utils')
-rw-r--r--source3/utils/net_registry_util.c16
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)