diff options
author | Jeremy Allison <jra@samba.org> | 2012-01-26 17:10:44 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2012-01-27 03:43:21 +0100 |
commit | a9e03337c1dbf13dcab5bf1f825bc1853b61256e (patch) | |
tree | 1496b68a25924905151792f6dd1d37836c598b90 /source3/lib/substitute_generic.c | |
parent | 17a77ea9b484a7040098fc66cf78625df4c14c65 (diff) | |
download | samba-a9e03337c1dbf13dcab5bf1f825bc1853b61256e.tar.gz samba-a9e03337c1dbf13dcab5bf1f825bc1853b61256e.tar.bz2 samba-a9e03337c1dbf13dcab5bf1f825bc1853b61256e.zip |
Finally remove all malloc()'s from the substitute code. Now totally
talloc() based.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Jan 27 03:43:21 CET 2012 on sn-devel-104
Diffstat (limited to 'source3/lib/substitute_generic.c')
-rw-r--r-- | source3/lib/substitute_generic.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/lib/substitute_generic.c b/source3/lib/substitute_generic.c index fa347fb815..f24608eb96 100644 --- a/source3/lib/substitute_generic.c +++ b/source3/lib/substitute_generic.c @@ -51,7 +51,7 @@ char *realloc_string_sub2(char *string, s = string; - in = SMB_STRDUP(insert); + in = talloc_strdup(talloc_tos(), insert); if (!in) { DEBUG(0, ("realloc_string_sub: out of memory!\n")); return NULL; @@ -88,11 +88,11 @@ char *realloc_string_sub2(char *string, while ((p = strstr_m(s,pattern))) { if (ld > 0) { int offset = PTR_DIFF(s,string); - string = (char *)SMB_REALLOC(string, ls + ld + 1); + string = talloc_realloc(NULL, string, char, ls + ld + 1); if (!string) { DEBUG(0, ("realloc_string_sub: " "out of memory!\n")); - SAFE_FREE(in); + talloc_free(in); return NULL; } p = string + offset + (p - s); @@ -104,7 +104,7 @@ char *realloc_string_sub2(char *string, s = p + li; ls += ld; } - SAFE_FREE(in); + talloc_free(in); return string; } |