Fix Coverity CIDs 887, 888. Don't pass NULL's to functions
[ira/wip.git] / source3 / passdb / pdb_wbc_sam.c
index 2161d2ff5c473b7e74271a5613a1f877081ea184..df80411a7a284c190538497efaf3364f2056a18b 100644 (file)
@@ -316,13 +316,12 @@ static NTSTATUS pdb_wbc_sam_getgrnam(struct pdb_methods *methods, GROUP_MAP *map
                                 const char *name)
 {
        NTSTATUS result = NT_STATUS_OK;
-       char *user_name = NULL;
-       char *domain = NULL;
+       const char *domain = "";
        DOM_SID sid;
        gid_t gid;
        enum lsa_SidType name_type;
 
-       if (!winbind_lookup_name(domain, user_name, &sid, &name_type)) {
+       if (!winbind_lookup_name(domain, name, &sid, &name_type)) {
                result = NT_STATUS_NO_SUCH_GROUP;
                goto done;
        }
@@ -340,7 +339,7 @@ static NTSTATUS pdb_wbc_sam_getgrnam(struct pdb_methods *methods, GROUP_MAP *map
                goto done;
        }
 
-       if (!_make_group_map(methods, domain, user_name, name_type, gid, &sid, map)) {
+       if (!_make_group_map(methods, domain, name, name_type, gid, &sid, map)) {
                result = NT_STATUS_NO_SUCH_GROUP;
                goto done;
        }