svn commit: samba r4304 - in trunk/source/lib: .

jra at samba.org jra at samba.org
Tue Dec 21 04:34:07 GMT 2004


Author: jra
Date: 2004-12-21 04:34:07 +0000 (Tue, 21 Dec 2004)
New Revision: 4304

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=4304

Log:
Fix from Albert Chin (china at thewrittenword.com) to fix the
earlier malloc changes.
Jeremy.

Modified:
   trunk/source/lib/sysacls.c
   trunk/source/lib/util_smbd.c


Changeset:
Modified: trunk/source/lib/sysacls.c
===================================================================
--- trunk/source/lib/sysacls.c	2004-12-21 03:29:09 UTC (rev 4303)
+++ trunk/source/lib/sysacls.c	2004-12-21 04:34:07 UTC (rev 4304)
@@ -722,7 +722,7 @@
 	 * 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 @@
 	 * 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	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	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 @@
 		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;
 	}

Modified: trunk/source/lib/util_smbd.c
===================================================================
--- trunk/source/lib/util_smbd.c	2004-12-21 03:29:09 UTC (rev 4303)
+++ trunk/source/lib/util_smbd.c	2004-12-21 04:34:07 UTC (rev 4304)
@@ -54,7 +54,7 @@
 		
 		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);



More information about the samba-cvs mailing list