From a9e03337c1dbf13dcab5bf1f825bc1853b61256e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 26 Jan 2012 17:10:44 -0800 Subject: Finally remove all malloc()'s from the substitute code. Now totally talloc() based. Autobuild-User: Jeremy Allison Autobuild-Date: Fri Jan 27 03:43:21 CET 2012 on sn-devel-104 --- source3/lib/substitute_generic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/lib/substitute_generic.c') 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; } -- cgit