@@ -336,6 +336,9 @@ static void mcap_notify_error(struct mcap_mcl *mcl, GError *err)
case MCAP_MD_CREATE_MDL_REQ:
st = MDL_WAITING;
l = g_slist_find_custom(mcl->mdls, &st, cmp_mdl_state);
+ if (!l)
+ return;
+
mdl = l->data;
mcl->mdls = g_slist_remove(mcl->mdls, mdl);
mcap_mdl_unref(mdl);
@@ -345,6 +348,9 @@ static void mcap_notify_error(struct mcap_mcl *mcl, GError *err)
case MCAP_MD_ABORT_MDL_REQ:
st = MDL_WAITING;
l = g_slist_find_custom(mcl->mdls, &st, cmp_mdl_state);
+ if (!l)
+ return;
+
shutdown_mdl(l->data);
update_mcl_state(mcl);
con->cb.notify(err, con->user_data);
@@ -362,6 +368,9 @@ static void mcap_notify_error(struct mcap_mcl *mcl, GError *err)
case MCAP_MD_RECONNECT_MDL_REQ:
st = MDL_WAITING;
l = g_slist_find_custom(mcl->mdls, &st, cmp_mdl_state);
+ if (!l)
+ return;
+
shutdown_mdl(l->data);
update_mcl_state(mcl);
con->cb.op(NULL, err, con->user_data);