From c3341ed29a2182a3a5f6c05110acd25513767b1a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 30 Mar 2018 09:16:47 -0500 Subject: [PATCH] net: Avoid tallocs Not really performance critical, but I think it's worth establishing sample code to use more stack variables than going out to talloc. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison Reviewed-by: Stefan Metzmacher --- source3/utils/net_cache.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source3/utils/net_cache.c b/source3/utils/net_cache.c index 98c5803c4285..f9d12ef4945c 100644 --- a/source3/utils/net_cache.c +++ b/source3/utils/net_cache.c @@ -462,8 +462,9 @@ static int net_cache_samlogon_show(struct net_context *c, } for (i = 0; i < num_user_sids; i++) { - d_printf("SID %2" PRIu32 ": %s\n", - i, sid_string_dbg(&user_sids[i])); + char buf[DOM_SID_STR_BUFLEN]; + dom_sid_string_buf(&user_sids[i], buf, sizeof(buf)); + d_printf("SID %2" PRIu32 ": %s\n", i, buf); } TALLOC_FREE(user_sids); -- 2.34.1