mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-05 07:11:36 +08:00
fix resource leak in mavlink_main.cpp: close the socket
This commit is contained in:
@@ -2249,6 +2249,11 @@ Mavlink::task_main(int argc, char *argv[])
|
|||||||
::close(_uart_fd);
|
::close(_uart_fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_socket_fd >= 0) {
|
||||||
|
close(_socket_fd);
|
||||||
|
_socket_fd = -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (_forwarding_on || _ftp_on) {
|
if (_forwarding_on || _ftp_on) {
|
||||||
message_buffer_destroy();
|
message_buffer_destroy();
|
||||||
pthread_mutex_destroy(&_message_buffer_mutex);
|
pthread_mutex_destroy(&_message_buffer_mutex);
|
||||||
|
|||||||
Reference in New Issue
Block a user