diff options
Diffstat (limited to 'source4/lib/registry/tools/regshell.c')
-rw-r--r-- | source4/lib/registry/tools/regshell.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c index 2c692952fb..329d6ab670 100644 --- a/source4/lib/registry/tools/regshell.c +++ b/source4/lib/registry/tools/regshell.c @@ -500,7 +500,7 @@ int main(int argc, char **argv) ctx->registry = reg_common_open_remote(remote, cmdline_lp_ctx, cmdline_credentials); } else if (file != NULL) { - ctx->current = reg_common_open_file(file, cmdline_credentials); + ctx->current = reg_common_open_file(file, cmdline_lp_ctx, cmdline_credentials); if (ctx->current == NULL) return 1; ctx->registry = ctx->current->context; @@ -546,12 +546,16 @@ int main(int argc, char **argv) via readline :-( */ line = smb_readline(prompt, NULL, reg_completion); - if (line == NULL) + if (line == NULL) { + free(prompt); break; + } if (line[0] != '\n') { ret = W_ERROR_IS_OK(process_cmd(ctx, line)); } + free(line); + free(prompt); } talloc_free(ctx); |