mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
registry: don't leak (to talloc_tos()) in regdb_store_keys().
use talloc_stackframe() and free on error path. Michael
This commit is contained in:
parent
966b2414cb
commit
95525772f2
@ -459,7 +459,7 @@ bool regdb_store_keys(const char *key, REGSUBKEY_CTR *ctr)
|
||||
char *path = NULL;
|
||||
REGSUBKEY_CTR *subkeys = NULL, *old_subkeys = NULL;
|
||||
char *oldkeyname = NULL;
|
||||
TALLOC_CTX *ctx = talloc_tos();
|
||||
TALLOC_CTX *ctx = talloc_stackframe();
|
||||
NTSTATUS status;
|
||||
|
||||
/*
|
||||
@ -623,6 +623,7 @@ bool regdb_store_keys(const char *key, REGSUBKEY_CTR *ctr)
|
||||
fail:
|
||||
TALLOC_FREE(old_subkeys);
|
||||
TALLOC_FREE(subkeys);
|
||||
TALLOC_FREE(ctx);
|
||||
|
||||
if (regdb->transaction_cancel(regdb) == -1) {
|
||||
smb_panic("regdb_store_keys: transaction_cancel failed\n");
|
||||
|
Loading…
Reference in New Issue
Block a user