Browse code

core: fix TCP connection leak

- patch provided by Vitally Aleksandrov

Peter Dunkley authored on 01/10/2013 09:52:01
Showing 1 changed files
... ...
@@ -2509,9 +2509,11 @@ char* via_builder( unsigned int *len,
2509 2509
 		} else if (con->rcv.proto==PROTO_WSS) {
2510 2510
 			memcpy(line_buf+MY_VIA_LEN-4, "WSS ", 4);
2511 2511
 		} else {
2512
+			tcpconn_put(con);
2512 2513
 			LOG(L_CRIT, "BUG: via_builder: unknown proto %d\n", con->rcv.proto);
2513 2514
 			return 0;
2514 2515
 		}
2516
+		tcpconn_put(con);
2515 2517
 	}else if (send_info->proto==PROTO_WSS){
2516 2518
 		memcpy(line_buf+MY_VIA_LEN-4, "WSS ", 4);
2517 2519
 	}else{