mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
Merge "res_sorcery_memory_cache.c: Fix off nominal ref leak."
This commit is contained in:
@@ -850,13 +850,16 @@ static void *sorcery_memory_cache_retrieve_id(const struct ast_sorcery *sorcery,
|
|||||||
if (cached->stale_update_sched_id == -1) {
|
if (cached->stale_update_sched_id == -1) {
|
||||||
struct stale_update_task_data *task_data;
|
struct stale_update_task_data *task_data;
|
||||||
|
|
||||||
task_data = stale_update_task_data_alloc((struct ast_sorcery *)sorcery, cache,
|
task_data = stale_update_task_data_alloc((struct ast_sorcery *) sorcery,
|
||||||
type, cached->object);
|
cache, type, cached->object);
|
||||||
if (task_data) {
|
if (task_data) {
|
||||||
ast_debug(1, "Cached sorcery object type '%s' ID '%s' is stale. Refreshing\n",
|
ast_debug(1, "Cached sorcery object type '%s' ID '%s' is stale. Refreshing\n",
|
||||||
type, id);
|
type, id);
|
||||||
cached->stale_update_sched_id = ast_sched_add(sched, 1, stale_item_update, task_data);
|
cached->stale_update_sched_id = ast_sched_add(sched, 1,
|
||||||
} else {
|
stale_item_update, task_data);
|
||||||
|
}
|
||||||
|
if (cached->stale_update_sched_id < 0) {
|
||||||
|
ao2_cleanup(task_data);
|
||||||
ast_log(LOG_ERROR, "Unable to update stale cached object type '%s', ID '%s'.\n",
|
ast_log(LOG_ERROR, "Unable to update stale cached object type '%s', ID '%s'.\n",
|
||||||
type, id);
|
type, id);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user