nfs4acls: Use talloc_realloc()
authorVolker Lendecke <vl@samba.org>
Tue, 11 Aug 2015 11:36:45 +0000 (13:36 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 13 Aug 2015 12:40:16 +0000 (14:40 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/modules/nfs4_acls.c

index fda4728e8c0e124f3d162384f82aca6755f03ebb..a680ad182e37ec6ec78e13dc78fa44f8b73ac4f4 100644 (file)
@@ -456,9 +456,9 @@ static bool smbacl4_nfs42win(TALLOC_CTX *mem_ctx,
                }
        }
 
-       nt_ace_list = (struct security_ace *)
-               TALLOC_REALLOC(mem_ctx, nt_ace_list,
-                                      good_aces * sizeof(struct security_ace));
+       nt_ace_list = talloc_realloc(mem_ctx, nt_ace_list, struct security_ace,
+                                    good_aces);
+
        /* returns a NULL ace list when good_aces is zero. */
        if (good_aces && nt_ace_list == NULL) {
                DEBUG(10, ("realloc error with %d aces", good_aces));