[PATCH 3/6] loadparm: use lp_printername ctx param instead of tos

David Disseldorp ddiss at samba.org
Tue Nov 19 16:48:51 MST 2013


lp_printername() takes a TALLOC_CTX argument, but proceeds to use
talloc_tos() in a subsequent lp__printername call. Fix it to use the
parameter - most callers use talloc_tos() as the argument, the others
have a temporary context around.

Signed-off-by: David Disseldorp <ddiss at samba.org>
---
 source3/param/loadparm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index d3fb839..1396a34 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -5274,7 +5274,7 @@ void lp_copy_service(int snum, const char *new_name)
 
 const char *lp_printername(TALLOC_CTX *ctx, int snum)
 {
-	const char *ret = lp__printername(talloc_tos(), snum);
+	const char *ret = lp__printername(ctx, snum);
 	if (ret == NULL || *ret == '\0') {
 		ret = lp_const_servicename(snum);
 	}
-- 
1.8.1.4



More information about the samba-technical mailing list