From 3095cbd63526ae474482e45175695b9fdf41cd3e Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 15 Jan 2003 12:48:06 +0000 Subject: 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 c781e34d274f4185ec932cc59029d3f9a65e47c4) --- source3/lib/util_str.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c index 4d3a808f165..148181fdddc 100644 --- a/source3/lib/util_str.c +++ b/source3/lib/util_str.c @@ -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); } -- cgit