Don't close file descriptor if failed to create it. --- android/android-tester.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/android/android-tester.c b/android/android-tester.c index 09c76c9..d7e80fb 100644 --- a/android/android-tester.c +++ b/android/android-tester.c @@ -390,7 +390,9 @@ static void emulator(int pipe, int hci_index) failed: close(pipe); - close(fd); + + if (fd >= 0) + close(fd); } static void adapter_state_changed_cb(bt_state_t state) -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html