]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib: Slightly optimize smb_fname_str_dbg()
authorVolker Lendecke <vl@samba.org>
Tue, 3 Nov 2020 11:33:12 +0000 (12:33 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 10 Nov 2020 19:49:33 +0000 (19:49 +0000)
Don't leak "fname"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/filename_util.c

index fb79dab09bd7f9bc4eaabfc2363bcda22d369178..f535ea1f088d780e468dcdf77ab0e29946160a8c 100644 (file)
@@ -165,10 +165,8 @@ const char *smb_fname_str_dbg(const struct smb_filename *smb_fname)
                return "";
        }
 
-       fname = talloc_asprintf(talloc_tos(),
-                               "%s {%s}",
-                               fname,
-                               tstr);
+       fname = talloc_asprintf_append_buffer(
+               fname, " {%s}", tstr);
        if (fname == NULL) {
                return "";
        }