summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-12-16 21:16:48 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:39 -0500
commit59f2d8590d63879f01803e4fdd135ffb0698207f (patch)
treee0a4714884aaffeb44f0af53e00b74ec0c2b0dcd
parent09969123e1e84ef0867bfade150e9e5c66e6ef5f (diff)
downloadsamba-59f2d8590d63879f01803e4fdd135ffb0698207f.tar.gz
samba-59f2d8590d63879f01803e4fdd135ffb0698207f.tar.bz2
samba-59f2d8590d63879f01803e4fdd135ffb0698207f.zip
r4241: More *alloc fixes.
Jeremy. (This used to be commit ec9606f00b52eb0d3a1a4c5eb98d171660ef19ad)
-rw-r--r--source3/lib/replace.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/lib/replace.c b/source3/lib/replace.c
index fe1cfc04eb..ddf6a02104 100644
--- a/source3/lib/replace.c
+++ b/source3/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);