diff --git a/src/modules/simulator/simulator_mavlink.cpp b/src/modules/simulator/simulator_mavlink.cpp index 422c31a1ac..89aeddc9ed 100644 --- a/src/modules/simulator/simulator_mavlink.cpp +++ b/src/modules/simulator/simulator_mavlink.cpp @@ -673,6 +673,7 @@ void Simulator::poll_for_MAVLink_messages() if (bind(_fd, (struct sockaddr *)&_myaddr, sizeof(_myaddr)) < 0) { PX4_ERR("bind for UDP port %i failed (%i)", _port, errno); + ::close(_fd); return; } diff --git a/src/systemcmds/dumpfile/dumpfile.c b/src/systemcmds/dumpfile/dumpfile.c index 981c701b6d..8f2e798944 100644 --- a/src/systemcmds/dumpfile/dumpfile.c +++ b/src/systemcmds/dumpfile/dumpfile.c @@ -99,6 +99,7 @@ dumpfile_main(int argc, char *argv[]) if (tcsetattr(out, TCSANOW, &tc) < 0) { PX4_ERR("failed setting stdout attributes"); + fclose(f); return 1; }