]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
sorcery: Fix cache creation callback. 33/533/1
authorJoshua Colp <jcolp@digium.com>
Tue, 26 May 2015 12:44:18 +0000 (09:44 -0300)
committerJoshua Colp <jcolp@digium.com>
Tue, 26 May 2015 12:44:18 +0000 (09:44 -0300)
The cache creation callback function expects to receive a sorcery_details
structure and not just a standalone object.

Change-Id: I3e4a5a137cb25292eb52d7a14cbb6daa09213450

main/sorcery.c

index af6de7e82cfdb64057be5248ba8100e88567851d..8101af055e3e59f4da279c4fc8c2fe8a44bbe2d8 100644 (file)
@@ -1822,7 +1822,12 @@ void *ast_sorcery_retrieve_by_id(const struct ast_sorcery *sorcery, const char *
        }
 
        if (!cached && object) {
-               AST_VECTOR_CALLBACK(&object_type->wizards, sorcery_cache_create, NULL, object, 0);
+               struct sorcery_details sdetails = {
+                       .sorcery = sorcery,
+                       .obj = object,
+               };
+
+               AST_VECTOR_CALLBACK(&object_type->wizards, sorcery_cache_create, NULL, &sdetails, 0);
        }
        AST_VECTOR_RW_UNLOCK(&object_type->wizards);