s4:dsdb - remove some calls of "samdb_msg_add_string" when we have talloc'ed strings
[ira/wip.git] / source4 / rpc_server / netlogon / dcerpc_netlogon.c
index 680b766692e4f325c5082da3fa47aad6c7a7fdda..2f80c1bcceab726bb4b8c97ab062054a6b12d4c0 100644 (file)
@@ -1431,16 +1431,12 @@ static NTSTATUS dcesrv_netr_LogonGetDomainInfo(struct dcesrv_call_state *dce_cal
                                "dNSHostname",
                        r->in.query->workstation_info->dns_hostname);
 
-                       samdb_msg_add_string(sam_ctx, mem_ctx, new_msg,
-                               "servicePrincipalName",
-                               talloc_asprintf(mem_ctx, "HOST/%s",
-                               r->in.computer_name)
-                       );
-                       samdb_msg_add_string(sam_ctx, mem_ctx, new_msg,
-                               "servicePrincipalName",
-                               talloc_asprintf(mem_ctx, "HOST/%s",
-                               r->in.query->workstation_info->dns_hostname)
-                       );
+                       ldb_msg_add_string(new_msg, "servicePrincipalName",
+                                          talloc_asprintf(new_msg, "HOST/%s",
+                                          r->in.computer_name));
+                       ldb_msg_add_string(new_msg, "servicePrincipalName",
+                                          talloc_asprintf(new_msg, "HOST/%s",
+                                          r->in.query->workstation_info->dns_hostname));
                }
 
                if (dsdb_replace(sam_ctx, new_msg, 0) != LDB_SUCCESS) {