summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-01-15 12:48:06 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-01-15 12:48:06 +0000
commit3095cbd63526ae474482e45175695b9fdf41cd3e (patch)
tree0522eccc43ddd631ac0fcba5c7a4f651d1a120dd /source3
parenteb6312af9fcf91b7709af50b499bc3b01eddeee5 (diff)
downloadsamba-3095cbd63526ae474482e45175695b9fdf41cd3e.tar.gz
samba-3095cbd63526ae474482e45175695b9fdf41cd3e.tar.bz2
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)
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/util_str.c4
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);
}