git.samba.org
/
metze
/
samba
/
wip.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
s4-registry: Don't leak memory on error.
[metze/samba/wip.git]
/
source4
/
lib
/
registry
/
tools
/
regshell.c
diff --git
a/source4/lib/registry/tools/regshell.c
b/source4/lib/registry/tools/regshell.c
index 1a4067bce35352beafa31b7edd172d7d61f1240a..dd154f78c94ed98bdd5a9c2e5fb7224a07f04f51 100644
(file)
--- 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 {
} else if(W_ERROR_EQUAL(status, WERR_NO_MORE_ITEMS)) {
break;
} else {
+ int n;
+
printf("Error creating completion list: %s\n",
win_errstr(status));
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;
}
talloc_free(mem_ctx);
return NULL;
}