r4305: Fix from Albert Chin (china@thewrittenword.com) to fix the
authorJeremy Allison <jra@samba.org>
Tue, 21 Dec 2004 04:34:14 +0000 (04:34 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:53:43 +0000 (10:53 -0500)
earlier malloc changes.
Jeremy.

source/lib/sysacls.c
source/lib/util_smbd.c

index f5801af8c55aec9692074f9397656590cc5a5562..4484810884da8ed152a4af576cbad97735cb36cd 100644 (file)
@@ -722,7 +722,7 @@ SMB_ACL_T sys_acl_init(int count)
         * acl[] array, this actually allocates an ACL with room
         * for (count+1) entries
         */
-       if ((a = SMB_MALLOC(sizeof(*a) + count * sizeof(struct acl))) == NULL) {
+       if ((a = SMB_MALLOC(sizeof(struct SMB_ACL_T) + count * sizeof(struct acl))) == NULL) {
                errno = ENOMEM;
                return NULL;
        }
@@ -1353,7 +1353,7 @@ SMB_ACL_T sys_acl_init(int count)
         * acl[] array, this actually allocates an ACL with room
         * for (count+1) entries
         */
-       if ((a = SMB_MALLOC(sizeof(*a) + count * sizeof(struct acl))) == NULL) {
+       if ((a = SMB_MALLOC(sizeof(struct SMB_ACL_T) + count * sizeof(struct acl))) == NULL) {
                errno = ENOMEM;
                return NULL;
        }
@@ -1982,7 +1982,7 @@ SMB_ACL_T sys_acl_get_file(const char *path_p, SMB_ACL_TYPE_T type)
 {
        SMB_ACL_T       a;
 
-       if ((a = SMB_MALLOC_P(SMB_ACL_T)) == NULL) {
+       if ((a = SMB_MALLOC_P(struct SMB_ACL_T)) == NULL) {
                errno = ENOMEM;
                return NULL;
        }
@@ -1999,7 +1999,7 @@ SMB_ACL_T sys_acl_get_fd(int fd)
 {
        SMB_ACL_T       a;
 
-       if ((a = SMB_MALLOC_P(SMB_ACL_T)) == NULL) {
+       if ((a = SMB_MALLOC_P(struct SMB_ACL_T)) == NULL) {
                errno = ENOMEM;
                return NULL;
        }
@@ -2056,7 +2056,7 @@ SMB_ACL_T sys_acl_init(int count)
                return NULL;
        }
 
-       if ((a = SMB_MALLOC_P(struct acl)) == NULL) {
+       if ((a = SMB_MALLOC(sizeof(struct SMB_ACL_T) + sizeof(struct acl))) == NULL) {
                errno = ENOMEM;
                return NULL;
        }
index 2eb0bb7cc07bb7930673f6552b27af9be438008c..58e7d9c6275d1fb40a551cf02f1d2e4eade789e5 100644 (file)
@@ -54,7 +54,7 @@ BOOL getgroups_user(const char *user, gid_t primary_gid, gid_t **ret_groups, int
                
                gid_t *groups_tmp;
                
-               groups_tmp = SMB_REALLOC(temp_groups, gid_t, max_grp);
+               groups_tmp = SMB_REALLOC_ARRAY(temp_groups, gid_t, max_grp);
                
                if (!groups_tmp) {
                        SAFE_FREE(temp_groups);