summaryrefslogtreecommitdiff
path: root/source4/lib/registry/tools
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2007-12-14 14:04:56 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:50:18 +0100
commit43ac3d9b44b98d44db9b1550c47e8f96a410d1e9 (patch)
tree9289d7b30bd6a0be28b4935a7314da0373e4b47c /source4/lib/registry/tools
parentd8feba9faf8f135109e347b5bf5fa054df97a11a (diff)
downloadsamba-43ac3d9b44b98d44db9b1550c47e8f96a410d1e9.tar.gz
samba-43ac3d9b44b98d44db9b1550c47e8f96a410d1e9.tar.bz2
samba-43ac3d9b44b98d44db9b1550c47e8f96a410d1e9.zip
r26453: Janitorial: Don't use a static char[] in smb_readline_replacement.
Fix up callers to free the memory returned, as that is needed if we use the original readline function as well. (This used to be commit c81ead1c38f417d442157b21d0d389f6a540c6f9)
Diffstat (limited to 'source4/lib/registry/tools')
-rw-r--r--source4/lib/registry/tools/regshell.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c
index 1c5157e937..329d6ab670 100644
--- a/source4/lib/registry/tools/regshell.c
+++ b/source4/lib/registry/tools/regshell.c
@@ -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);