summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2013-02-20 10:03:13 +0100
committerAlexander Bokovoy <ab@samba.org>2013-02-22 16:36:14 +0100
commit66ee744ccbb0a57e651d76881328554dffab8bcd (patch)
tree29502bd375f91853eef5d489b6958074dd68a0e4 /source4/lib
parentb055798c5660e48f88b74478b89ce88aae9ed019 (diff)
downloadsamba-66ee744ccbb0a57e651d76881328554dffab8bcd.tar.gz
samba-66ee744ccbb0a57e651d76881328554dffab8bcd.tar.bz2
samba-66ee744ccbb0a57e651d76881328554dffab8bcd.zip
s4-registry: Don't leak memory on error.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/registry/tools/regshell.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c
index 1a4067bce3..dd154f78c9 100644
--- a/source4/lib/registry/tools/regshell.c
+++ b/source4/lib/registry/tools/regshell.c
@@ -508,8 +508,15 @@ static char **reg_complete_key(const char *text, int start, int end)
} else if(W_ERROR_EQUAL(status, WERR_NO_MORE_ITEMS)) {
break;
} else {
+ int n;
+
printf("Error creating completion list: %s\n",
win_errstr(status));
+
+ for (n = j; n >= 0; n--) {
+ SAFE_FREE(matches[n]);
+ }
+ SAFE_FREE(matches);
talloc_free(mem_ctx);
return NULL;
}