summaryrefslogtreecommitdiffstats
path: root/source3/utils
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_rpc_printer.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c
index 3cdac6223f..f5247b2935 100644
--- a/source3/utils/net_rpc_printer.c
+++ b/source3/utils/net_rpc_printer.c
@@ -1643,7 +1643,17 @@ NTSTATUS rpc_printer_migrate_security_internals(struct net_context *c,
/* copy secdesc (info level 2) */
info_dst.info2.devmode = NULL;
- info_dst.info2.secdesc = dup_sec_desc(mem_ctx, info_src.info3.secdesc);
+ if (info_src.info3.secdesc == NULL) {
+ info_dst.info2.secdesc = NULL;
+ } else {
+ info_dst.info2.secdesc
+ = security_descriptor_copy(mem_ctx,
+ info_src.info3.secdesc);
+ if (info_dst.info2.secdesc == NULL) {
+ nt_status = NT_STATUS_NO_MEMORY;
+ goto done;
+ }
+ }
if (c->opt_verbose)
display_sec_desc(info_dst.info2.secdesc);