1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00

Doing a malloc(strlen(s)) then a pstrpcp(y, s) is just silly, make it a strdup

instead.

Andrew Bartlett
(This used to be commit c781e34d27)
This commit is contained in:
Andrew Bartlett 2003-01-15 12:48:06 +00:00
parent eb6312af9f
commit 3095cbd635

View File

@ -669,13 +669,11 @@ static BOOL string_init(char **dest,const char *src)
}
*dest = null_string;
} else {
(*dest) = (char *)malloc(l+1);
(*dest) = strdup(src);
if ((*dest) == NULL) {
DEBUG(0,("Out of memory in string_init\n"));
return False;
}
pstrcpy(*dest,src);
}
return(True);
}