diff options
author | Andrew Bartlett <abartlet@samba.org> | 2003-01-15 12:48:06 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2003-01-15 12:48:06 +0000 |
commit | 3095cbd63526ae474482e45175695b9fdf41cd3e (patch) | |
tree | 0522eccc43ddd631ac0fcba5c7a4f651d1a120dd | |
parent | eb6312af9fcf91b7709af50b499bc3b01eddeee5 (diff) | |
download | samba-3095cbd63526ae474482e45175695b9fdf41cd3e.tar.gz samba-3095cbd63526ae474482e45175695b9fdf41cd3e.tar.xz samba-3095cbd63526ae474482e45175695b9fdf41cd3e.zip |
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)
-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); } |