]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
loadparm: Simplify canonicalize_servicename()
authorVolker Lendecke <vl@samba.org>
Wed, 7 Jan 2026 11:56:28 +0000 (12:56 +0100)
committerVolker Lendecke <vl@samba.org>
Tue, 20 Jan 2026 11:53:34 +0000 (11:53 +0000)
We have strlower_talloc()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
source3/param/loadparm.c

index 410cb3ea937e5b4f006c152b38ea4bdc91324f5f..2a958057e66e76ec09916bc93cca6a15cb06726c 100644 (file)
@@ -1598,17 +1598,12 @@ char *canonicalize_servicename(TALLOC_CTX *ctx, const char *src)
        char *result;
 
        if ( !src ) {
-               DEBUG(0,("canonicalize_servicename: NULL source name!\n"));
+               DBG_ERR("NULL source name!\n");
                return NULL;
        }
 
-       result = talloc_strdup(ctx, src);
+       result = strlower_talloc(ctx, src);
        SMB_ASSERT(result != NULL);
-
-       if (!strlower_m(result)) {
-               TALLOC_FREE(result);
-               return NULL;
-       }
        return result;
 }