]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
htsp server: fix missing tcp_connection_land() call, caused memory corruptions
authorJaroslav Kysela <perex@perex.cz>
Tue, 7 Oct 2014 07:32:31 +0000 (09:32 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 7 Oct 2014 07:32:58 +0000 (09:32 +0200)
src/htsp_server.c

index 59059ee5b312ad6e3da4056b72ef849fe2f2c0f5..09402c5605e0c0518972e9efd6ae85d3fafc7ca2 100644 (file)
@@ -2346,7 +2346,7 @@ htsp_read_loop(htsp_connection_t *htsp)
   while(tvheadend_running) {
 readmsg:
     if((r = htsp_read_message(htsp, &m, 0)) != 0)
-      return r;
+      break;
 
     pthread_mutex_lock(&global_lock);
     if (htsp_authenticate(htsp, m)) {
@@ -2406,7 +2406,7 @@ readmsg:
   pthread_mutex_lock(&global_lock);
   tcp_connection_land(tcp_id);
   pthread_mutex_unlock(&global_lock);
-  return 0;
+  return tvheadend_running ? r : 0;
 }
 
 /**