Browse code

core: Fixed segmentation fault

- Tiny window for this... but I hit it when Google Chrome crashed during
a WebSocket session

Peter Dunkley authored on 30/06/2012 19:35:10
Showing 1 changed files
... ...
@@ -164,6 +164,12 @@ static inline int msg_send(struct dest_info* dst, char* buf, int len)
164 164
 			return -1;
165 165
 		}
166 166
 
167
+		if (con == NULL)
168
+		{
169
+			LM_WARN("TCP/TLS connection for WebSocket could not be found\n");
170
+			return -1;
171
+		}
172
+
167 173
 		memset(&wsev, 0, sizeof(ws_event_info_t));
168 174
 		wsev.type = SREV_TCP_WS_FRAME_OUT;
169 175
 		wsev.buf = outb.s;