]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libndr: Fix a talloc context leak
authorVolker Lendecke <vl@samba.org>
Fri, 29 Nov 2019 13:00:51 +0000 (14:00 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 2 Dec 2019 21:23:35 +0000 (21:23 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
librpc/ndr/ndr_basic.c

index 0bce1322265e31cd8305e6ad18961b126d7afe9b..5c717e698583dcbffba476e8a1c51a3e30270925 100644 (file)
@@ -1466,8 +1466,9 @@ _PUBLIC_ enum ndr_err_code ndr_pull_timespec(struct ndr_pull *ndr,
 _PUBLIC_ void ndr_print_timespec(struct ndr_print *ndr, const char *name,
                                 const struct timespec *t)
 {
-       ndr->print(ndr, "%-25s: %s.%ld", name, timestring(ndr, t->tv_sec),
-                  (long)t->tv_nsec);
+       char *str = timestring(ndr, t->tv_sec);
+       ndr->print(ndr, "%-25s: %s.%ld", name, str, t->tv_nsec);
+       TALLOC_FREE(str);
 }
 
 _PUBLIC_ enum ndr_err_code ndr_push_timeval(struct ndr_push *ndr,