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;
}
/****************************************************************************
duplicate a string
****************************************************************************/
+
+#ifdef strdup
+#undef strdup
+#endif
+
char *strdup(const char *s)
{
size_t len;
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);