s3:idmap_autorid: Add a NULL check in idmap_autorid_preallocate_wellknown
authorVolker Lendecke <vl@samba.org>
Thu, 11 Jul 2013 11:10:25 +0000 (13:10 +0200)
committerChristian Ambach <ambi@samba.org>
Mon, 8 Jul 2013 04:00:42 +0000 (06:00 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
source3/winbindd/idmap_autorid.c

index 493e6df3913fa700ae72a1ef036163b80ec72746..16f609d6852c65911803d767f9180bb85a333632 100644 (file)
@@ -843,6 +843,10 @@ static NTSTATUS idmap_autorid_preallocate_wellknown(struct idmap_domain *dom)
 
        for (i = 0; i < num; i++) {
                maps[i] = talloc(maps, struct id_map);
+               if (maps[i] == NULL) {
+                       talloc_free(maps);
+                       return NT_STATUS_NO_MEMORY;
+               }
                maps[i]->xid.type = ID_TYPE_GID;
                maps[i]->sid = dom_sid_parse_talloc(maps, groups[i]);
        }