*/
remove_stasis_end_published(chan);
+ if (!apps_registry) {
+ return -1;
+ }
+
app = ao2_find(apps_registry, app_name, OBJ_SEARCH_KEY);
if (!app) {
ast_log(LOG_ERROR,
{
RAII_VAR(struct stasis_app *, app, NULL, ao2_cleanup);
+ if (!apps_registry) {
+ return -1;
+ }
+
app = ao2_find(apps_registry, app_name, OBJ_SEARCH_KEY);
if (!app) {
/* XXX We can do a better job handling late binding, queueing up
{
struct stasis_app *res = NULL;
+ if (!apps_registry) {
+ return NULL;
+ }
+
if (!ast_strlen_zero(app_name)) {
res = ao2_find(apps_registry, app_name, OBJ_SEARCH_KEY);
}
{
RAII_VAR(struct ao2_container *, apps, NULL, ao2_cleanup);
+ if (!apps_registry) {
+ return NULL;
+ }
+
apps = ast_str_container_alloc(1);
if (!apps) {
return NULL;
{
RAII_VAR(struct stasis_app *, app, NULL, ao2_cleanup);
- SCOPED_LOCK(apps_lock, apps_registry, ao2_lock, ao2_unlock);
+ if (!apps_registry) {
+ return -1;
+ }
+ ao2_lock(apps_registry);
app = ao2_find(apps_registry, app_name, OBJ_SEARCH_KEY | OBJ_NOLOCK);
if (app) {
app_update(app, handler, data);
if (app) {
ao2_link_flags(apps_registry, app, OBJ_NOLOCK);
} else {
+ ao2_unlock(apps_registry);
return -1;
}
}
* prevent memory leaks, and we're lazy.
*/
cleanup();
+ ao2_unlock(apps_registry);
return 0;
}
return;
}
+ if (!apps_registry) {
+ return;
+ }
+
app = ao2_find(apps_registry, app_name, OBJ_SEARCH_KEY);
if (!app) {
ast_log(LOG_ERROR,
messaging_cleanup();
+ cleanup();
ao2_cleanup(apps_registry);
apps_registry = NULL;