diff options
-rw-r--r-- | source3/lib/util_str.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c index 4d3a808f16..148181fddd 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); } |