Fixed crash error when cli "module reload". The error appears when
compiling with res_prometheus and using the sorcery memory cache for
registrations
(cherry picked from commit
b8525e87aeb11c780b0b5d4e8729258c77352fcb)
/* If we are returning a single object and it came from a non-cache source create it in any caches */
if (!(flags & AST_RETRIEVE_FLAG_MULTIPLE) && !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);