git.samba.org
/
sfrench
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eb6312a
)
Doing a malloc(strlen(s)) then a pstrpcp(y, s) is just silly, make it a strdup
author
Andrew Bartlett
<abartlet@samba.org>
Wed, 15 Jan 2003 12:48:06 +0000
(12:48 +0000)
committer
Andrew Bartlett
<abartlet@samba.org>
Wed, 15 Jan 2003 12:48:06 +0000
(12:48 +0000)
instead.
Andrew Bartlett
(This used to be commit
c781e34d274f4185ec932cc59029d3f9a65e47c4
)
source3/lib/util_str.c
patch
|
blob
|
history
diff --git
a/source3/lib/util_str.c
b/source3/lib/util_str.c
index 4d3a808f165d9788c45256a92265c42d63bb0507..148181fdddc018d49cd52cb33faa273a0df50283 100644
(file)
--- 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);
}