svn commit: samba r4240 - in trunk/source/lib: .
jra at samba.org
jra at samba.org
Thu Dec 16 21:16:42 GMT 2004
Author: jra
Date: 2004-12-16 21:16:41 +0000 (Thu, 16 Dec 2004)
New Revision: 4240
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=4240
Log:
More *alloc fixes.
Jeremy.
Modified:
trunk/source/lib/replace.c
Changeset:
Modified: trunk/source/lib/replace.c
===================================================================
--- trunk/source/lib/replace.c 2004-12-16 21:14:15 UTC (rev 4239)
+++ trunk/source/lib/replace.c 2004-12-16 21:16:41 UTC (rev 4240)
@@ -205,7 +205,7 @@
struct group *g;
char *gr;
- if((grouplst = (gid_t *)malloc(sizeof(gid_t) * max_gr)) == NULL) {
+ if((grouplst = SMB_MALLOC_ARRAY(gid_t, max_gr)) == NULL) {
DEBUG(0,("initgroups: malloc fail !\n"));
return -1;
}
@@ -311,6 +311,11 @@
/****************************************************************************
duplicate a string
****************************************************************************/
+
+#ifdef strdup
+#undef strdup
+#endif
+
char *strdup(const char *s)
{
size_t len;
@@ -319,7 +324,7 @@
if (!s) return(NULL);
len = strlen(s)+1;
- ret = (char *)malloc(len);
+ ret = (char *)SMB_MALLOC(len);
if (!ret) return(NULL);
memcpy(ret,s,len);
return(ret);
More information about the samba-cvs
mailing list