diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/libnet/libnet_become_dc.c | 7 | ||||
-rw-r--r-- | source4/libnet/libnet_unbecome_dc.c | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c index 746b2429ce..5cd5f7ef22 100644 --- a/source4/libnet/libnet_become_dc.c +++ b/source4/libnet/libnet_become_dc.c @@ -1610,11 +1610,16 @@ static NTSTATUS becomeDC_ldap2_move_computer(struct libnet_BecomeDC_state *s) } ret = ldb_rename(s->ldap2.ldb, old_dn, new_dn); - talloc_free(r); if (ret != LDB_SUCCESS) { + talloc_free(r); return NT_STATUS_LDAP(ret); } + s->dest_dsa.computer_dn_str = ldb_dn_alloc_linearized(s, new_dn); + NT_STATUS_HAVE_NO_MEMORY(s->dest_dsa.computer_dn_str); + + talloc_free(r); + return NT_STATUS_OK; } diff --git a/source4/libnet/libnet_unbecome_dc.c b/source4/libnet/libnet_unbecome_dc.c index bc29501ac4..ffec396e21 100644 --- a/source4/libnet/libnet_unbecome_dc.c +++ b/source4/libnet/libnet_unbecome_dc.c @@ -328,11 +328,16 @@ static NTSTATUS unbecomeDC_ldap_move_computer(struct libnet_UnbecomeDC_state *s) } ret = ldb_rename(s->ldap.ldb, old_dn, new_dn); - talloc_free(r); if (ret != LDB_SUCCESS) { + talloc_free(r); return NT_STATUS_LDAP(ret); } + s->dest_dsa.computer_dn_str = ldb_dn_alloc_linearized(s, new_dn); + NT_STATUS_HAVE_NO_MEMORY(s->dest_dsa.computer_dn_str); + + talloc_free(r); + return NT_STATUS_OK; } |