Merge "res_http_post: Not all versions of gmime have GMIME_MAJOR_VERSION."
authorJoshua Colp <jcolp@digium.com>
Mon, 4 Dec 2017 13:40:06 +0000 (07:40 -0600)
committerGerrit Code Review <gerrit2@gerrit.digium.api>
Mon, 4 Dec 2017 13:40:06 +0000 (07:40 -0600)
channels/chan_skinny.c

index aeb0605..6f4231a 100644 (file)
@@ -7426,6 +7426,11 @@ static void destroy_session(struct skinnysession *s)
        }
        ast_mutex_unlock(&s->lock);
        ast_mutex_destroy(&s->lock);
+
+       if (s->t != AST_PTHREADT_NULL) {
+               pthread_detach(s->t);
+       }
+
        ast_free(s);
 }
 
@@ -7512,11 +7517,6 @@ static void *skinny_session(void *data)
        int eventmessage = 0;
        struct pollfd fds[1];
 
-       if (!s) {
-               ast_log(LOG_WARNING, "Bad Skinny Session\n");
-               return 0;
-       }
-
        ast_log(LOG_NOTICE, "Starting Skinny session from %s\n", ast_inet_ntoa(s->sin.sin_addr));
 
        pthread_cleanup_push(skinny_session_cleanup, s);
@@ -7682,6 +7682,7 @@ static void *accept_thread(void *ignore)
                s->keepalive_timeout_sched = -1;
 
                if (ast_pthread_create(&s->t, NULL, skinny_session, s)) {
+                       s->t = AST_PTHREADT_NULL;
                        destroy_session(s);
                }
        }