Fix unit tests leaking resources

This was harmless but none the less is not good style and needs fixing.
This commit is contained in:
Lorenz Meier
2017-01-03 09:26:02 +01:00
committed by Beat Küng
parent 2880bb185f
commit 9f3fe2a802
6 changed files with 27 additions and 52 deletions
@@ -35,6 +35,7 @@
* @file test_uart_loopback.c
* Tests the uart outputs
*
* @author Lorenz Meier <lorenz@px4.io>
*/
#include <px4_config.h>
@@ -75,6 +76,10 @@ int test_uart_loopback(int argc, char *argv[])
}
if (uart5 < 0) {
if (uart2 > 0) {
close(uart2);
}
printf("ERROR opening UART5, aborting..\n");
exit(uart5);
}