summaryrefslogtreecommitdiff
path: root/source3/libgpo
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2018-08-21 21:38:01 +0200
committerJeremy Allison <jra@samba.org>2018-08-22 00:58:41 +0200
commitf16d917297031d6fc92667b83b9c842195c63bf8 (patch)
tree04b9833725eae13579f2e859486d38a25e575824 /source3/libgpo
parent7460d9b97e11b710ce1ce95777f30e940629050b (diff)
downloadsamba-f16d917297031d6fc92667b83b9c842195c63bf8.tar.gz
libgpo: Fix CID 1438462 Error handling issues (CHECKED_RETURN)
Yes, this creates a leak of "data", but the other error exits in this function are the same. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/libgpo')
-rw-r--r--source3/libgpo/gpext/registry.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source3/libgpo/gpext/registry.c b/source3/libgpo/gpext/registry.c
index 525493fcb2c..ffa1d020fb6 100644
--- a/source3/libgpo/gpext/registry.c
+++ b/source3/libgpo/gpext/registry.c
@@ -111,6 +111,7 @@ static bool gp_reg_entry_from_file_entry(TALLOC_CTX *mem_ctx,
struct registry_value *data = NULL;
struct gp_registry_entry *entry = NULL;
enum gp_reg_action action = GP_REG_ACTION_NONE;
+ enum ndr_err_code ndr_err;
ZERO_STRUCTP(*reg_entry);
@@ -120,8 +121,17 @@ static bool gp_reg_entry_from_file_entry(TALLOC_CTX *mem_ctx,
data->type = r->type;
- ndr_push_union_blob(&data->data, mem_ctx, &r->data, r->type,
- (ndr_push_flags_fn_t)ndr_push_winreg_Data);
+ ndr_err = ndr_push_union_blob(
+ &data->data,
+ mem_ctx,
+ &r->data,
+ r->type,
+ (ndr_push_flags_fn_t)ndr_push_winreg_Data);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ DBG_WARNING("ndr_push_winreg_Data failed: %s\n",
+ ndr_errstr(ndr_err));
+ return false;
+ }
entry = talloc_zero(mem_ctx, struct gp_registry_entry);
if (!entry)