summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/astobj2.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main/astobj2.c b/main/astobj2.c
index 5e61d5e5f..5f4cda91e 100644
--- a/main/astobj2.c
+++ b/main/astobj2.c
@@ -734,6 +734,10 @@ static void *internal_ao2_callback(struct ao2_container *c,
}
ast_free(cur); /* free the link record */
}
+ if ((match) && (!(flags & OBJ_UNLINK))) {
+ AST_LIST_REMOVE_CURRENT(entry);
+ AST_LIST_INSERT_HEAD(&c->buckets[i], cur, entry);
+ }
if ((match & CMP_STOP) || !(flags & OBJ_MULTIPLE)) {
/* We found our only (or last) match, so force an exit from