Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
subscriptions: manage ths_mux_link early to avoid wrong memory accesses
  • Loading branch information
perexg committed Mar 11, 2015
1 parent 7cafa5e commit be3749f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/subscriptions.c
Expand Up @@ -514,6 +514,11 @@ subscription_unsubscribe(th_subscription_t *s, int quiet)

LIST_REMOVE(s, ths_global_link);

#if ENABLE_MPEGTS
if (s->ths_raw_service)
LIST_REMOVE(s, ths_mux_link);
#endif

if (s->ths_channel != NULL) {
LIST_REMOVE(s, ths_channel_link);
snprintf(buf, sizeof(buf), "\"%s\" unsubscribing from \"%s\"",
Expand All @@ -537,10 +542,8 @@ subscription_unsubscribe(th_subscription_t *s, int quiet)
}

#if ENABLE_MPEGTS
if (s->ths_raw_service) {
LIST_REMOVE(s, ths_mux_link);
if (s->ths_raw_service)
service_destroy(s->ths_raw_service, 0);
}
#endif

streaming_msg_free(s->ths_start_message);
Expand Down

0 comments on commit be3749f

Please sign in to comment.