]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
subscriptions: Plug possible memleak
authorAndreas Öman <andreas@lonelycoder.com>
Wed, 7 Nov 2012 08:27:58 +0000 (09:27 +0100)
committerAndreas Öman <andreas@lonelycoder.com>
Wed, 7 Nov 2012 08:29:33 +0000 (09:29 +0100)
src/subscriptions.c

index 1cae0a4f8389eba07c0bda0a1da1280073ebd6fa..2f56825b769c9d925e7037d82015948365ca878b 100644 (file)
@@ -79,9 +79,14 @@ subscription_link_service(th_subscription_t *s, service_t *t)
 
   pthread_mutex_lock(&t->s_stream_mutex);
 
-  if(TAILQ_FIRST(&t->s_components) != NULL)
+  if(TAILQ_FIRST(&t->s_components) != NULL) {
+
+    if(s->ths_start_message != NULL)
+      streaming_msg_free(s->ths_start_message);
+
     s->ths_start_message =
       streaming_msg_create_data(SMT_START, service_build_stream_start(t));
+  }
 
   // Link to service output
   streaming_target_connect(&t->s_streaming_pad, &s->ths_input);