diff options
-rw-r--r-- | channels/chan_skinny.c | 11 | ||||
-rw-r--r-- | res/res_http_post.c | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c index aeb060569..6f4231acd 100644 --- a/channels/chan_skinny.c +++ b/channels/chan_skinny.c @@ -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); } } diff --git a/res/res_http_post.c b/res/res_http_post.c index 9f5b1837a..dca18a6ad 100644 --- a/res/res_http_post.c +++ b/res/res_http_post.c @@ -55,7 +55,7 @@ #ifdef GMIME_TYPE_CONTENT_TYPE #define AST_GMIME_VER_24 #endif -#if GMIME_MAJOR_VERSION >= 3 +#if defined(GMIME_MAJOR_VERSION) && (GMIME_MAJOR_VERSION >= 3) #define AST_GMIME_VER_30 #endif |