fix resource leak in mavlink_main.cpp: close the socket

This commit is contained in:
Beat Küng 2016-06-06 16:48:16 +02:00
parent d8fbd8a6f6
commit 1f55e23827

View File

@ -2249,6 +2249,11 @@ Mavlink::task_main(int argc, char *argv[])
::close(_uart_fd);
}
if (_socket_fd >= 0) {
close(_socket_fd);
_socket_fd = -1;
}
if (_forwarding_on || _ftp_on) {
message_buffer_destroy();
pthread_mutex_destroy(&_message_buffer_mutex);