summaryrefslogtreecommitdiffstats
path: root/source/lib/replace.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-12-23 18:45:36 +0000
committerGerald Carter <jerry@samba.org>2004-12-23 18:45:36 +0000
commitb262548fec09659f46839dcf4c079176775f0871 (patch)
tree2f44f7f1cdce6d71d868626caea49fdfb82e1249 /source/lib/replace.c
parent8d91e07ef22ad3ed484b04bc4968380a24940696 (diff)
downloadsamba-b262548fec09659f46839dcf4c079176775f0871.tar.gz
samba-b262548fec09659f46839dcf4c079176775f0871.tar.xz
samba-b262548fec09659f46839dcf4c079176775f0871.zip
r4348: syncing up for 3.0.11pre1
Diffstat (limited to 'source/lib/replace.c')
-rw-r--r--source/lib/replace.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/lib/replace.c b/source/lib/replace.c
index fe1cfc04eb1..298707727e9 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);
@@ -415,7 +420,7 @@ char *rep_inet_ntoa(struct in_addr ip)
#ifndef HAVE_VSYSLOG
#ifdef HAVE_SYSLOG
- void vsyslog (int facility_priority, char *format, va_list arglist)
+ void vsyslog (int facility_priority, const char *format, va_list arglist)
{
char *msg = NULL;
vasprintf(&msg, format, arglist);