ast_free(state->context);
ast_free(state->exten);
ast_free(state);
+
+ ast_module_unref(ast_module_info->self);
}
static const struct ast_datastore_info hook_datastore = {
snprintf(uid, sizeof(uid), "%u", hook_id);
+ ast_module_ref(ast_module_info->self);
if (!(datastore = ast_datastore_alloc(&hook_datastore, uid))) {
+ ast_module_unref(ast_module_info->self);
return -1;
}
if (!(state = hook_state_alloc(context, exten, interval, hook_id))) {
+ ast_module_unref(ast_module_info->self);
ast_datastore_free(datastore);
return -1;
}