From: Jeremy Allison Date: Thu, 16 Dec 2004 21:16:48 +0000 (+0000) Subject: r4241: More *alloc fixes. X-Git-Tag: samba-misc-tags/initial-v3-0-unstable~5488 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ec9606f00b52eb0d3a1a4c5eb98d171660ef19ad;p=thirdparty%2Fsamba.git r4241: More *alloc fixes. Jeremy. --- diff --git a/source/lib/replace.c b/source/lib/replace.c index fe1cfc04eb1..ddf6a02104b 100644 --- a/source/lib/replace.c +++ b/source/lib/replace.c @@ -205,7 +205,7 @@ Corrections by richard.kettlewell@kewill.com 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 @@ needs. /**************************************************************************** duplicate a string ****************************************************************************/ + +#ifdef strdup +#undef strdup +#endif + char *strdup(const char *s) { size_t len; @@ -319,7 +324,7 @@ duplicate a string 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);