diff options
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r-- | source4/lib/ldb/common/ldb_msg.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source4/lib/ldb/common/ldb_msg.c b/source4/lib/ldb/common/ldb_msg.c index 59bd32090e..4d0149af8f 100644 --- a/source4/lib/ldb/common/ldb_msg.c +++ b/source4/lib/ldb/common/ldb_msg.c @@ -798,8 +798,9 @@ void ldb_msg_remove_element(struct ldb_message *msg, struct ldb_message_element */ void ldb_msg_remove_attr(struct ldb_message *msg, const char *attr) { - struct ldb_message_element *el = ldb_msg_find_element(msg, attr); - if (el) { + struct ldb_message_element *el; + + while ((el = ldb_msg_find_element(msg, attr)) != NULL) { ldb_msg_remove_element(msg, el); } } |