res_http_websocket.c: Add missing unref on an off nominal path.
authorRichard Mudgett <rmudgett@digium.com>
Tue, 18 Aug 2015 19:24:17 +0000 (14:24 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Tue, 18 Aug 2015 21:40:04 +0000 (16:40 -0500)
Change-Id: I228df6adecd4cb450d03e09e9a38c86bb566e811

res/res_http_websocket.c

index 86ec00c..c40aae6 100644 (file)
@@ -832,6 +832,7 @@ int AST_OPTIONAL_API_NAME(ast_websocket_uri_cb)(struct ast_tcptls_session_instan
                        ast_log(LOG_WARNING, "WebSocket connection from '%s' could not be accepted - failed to generate a session id\n",
                                ast_sockaddr_stringify(&ser->remote_address));
                        ast_http_error(ser, 500, "Internal Server Error", "Allocation failed");
                        ast_log(LOG_WARNING, "WebSocket connection from '%s' could not be accepted - failed to generate a session id\n",
                                ast_sockaddr_stringify(&ser->remote_address));
                        ast_http_error(ser, 500, "Internal Server Error", "Allocation failed");
+                       ao2_ref(protocol_handler, -1);
                        return 0;
                }
 
                        return 0;
                }