s3:vfs_gpfs: add no memory check in gpfs2smb_acl()
authorStefan Metzmacher <metze@samba.org>
Wed, 28 Nov 2012 10:44:58 +0000 (11:44 +0100)
committerMichael Adam <obnox@samba.org>
Wed, 28 Nov 2012 13:06:26 +0000 (14:06 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Nov 28 14:06:27 CET 2012 on sn-devel-104

source3/modules/vfs_gpfs.c

index b3ed3da5cf8c49545e5fdfe6fecb1926afcf8268..e2058e18323d6864929a57db10804cc677e58ba2 100644 (file)
@@ -575,6 +575,11 @@ static SMB_ACL_T gpfs2smb_acl(const struct gpfs_acl *pacl, TALLOC_CTX *mem_ctx)
        result->count = pacl->acl_nace;
        result->acl = talloc_realloc(result, result->acl, struct smb_acl_entry,
                                     result->count);
+       if (result->acl == NULL) {
+               TALLOC_FREE(result);
+               errno = ENOMEM;
+               return NULL;
+       }
 
        for (i=0; i<pacl->acl_nace; i++) {
                struct smb_acl_entry *ace = &result->acl[i];