diff options
Diffstat (limited to 'source4/lib/ldb/common')
-rw-r--r-- | source4/lib/ldb/common/ldb_msg.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source4/lib/ldb/common/ldb_msg.c b/source4/lib/ldb/common/ldb_msg.c index 8b51ad087c..d1c77f89bc 100644 --- a/source4/lib/ldb/common/ldb_msg.c +++ b/source4/lib/ldb/common/ldb_msg.c @@ -890,11 +890,14 @@ int ldb_msg_rename_attr(struct ldb_message *msg, const char *attr, const char *r int ldb_msg_copy_attr(struct ldb_message *msg, const char *attr, const char *replace) { struct ldb_message_element *el = ldb_msg_find_element(msg, attr); + int ret; + if (el == NULL) { return LDB_SUCCESS; } - if (ldb_msg_add(msg, el, 0) != 0) { - return LDB_ERR_OPERATIONS_ERROR; + ret = ldb_msg_add(msg, el, 0); + if (ret != LDB_SUCCESS) { + return ret; } return ldb_msg_rename_attr(msg, attr, replace); } |