summaryrefslogtreecommitdiff
path: root/source3/lib/genparser.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/genparser.c')
-rw-r--r--source3/lib/genparser.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/source3/lib/genparser.c b/source3/lib/genparser.c
index 233050b432..7476b5d0af 100644
--- a/source3/lib/genparser.c
+++ b/source3/lib/genparser.c
@@ -256,7 +256,6 @@ static int gen_dump_array(TALLOC_CTX *mem_ctx,
addstr(mem_ctx, p, "}\n")) {
return -1;
}
- free(s);
return 0;
}
@@ -673,7 +672,7 @@ int gen_parse(TALLOC_CTX *mem_ctx, const struct parse_struct *pinfo, char *data,
{
char *str, *s0;
- s0 = strdup(s);
+ s0 = talloc_strdup(mem_ctx, s);
str = s0;
while (*str) {
@@ -706,12 +705,10 @@ int gen_parse(TALLOC_CTX *mem_ctx, const struct parse_struct *pinfo, char *data,
*str++ = 0;
if (gen_parse_one(mem_ctx, pinfo, name, data, value) != 0) {
- free(s0);
return -1;
}
}
- free(s0);
return 0;
}