From 050aa94b8b2dea275420c542e90f1594b1ea8254 Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Wed, 19 Aug 2020 15:15:37 +0200 Subject: [PATCH] main: delete jtag if someone is wrong --- src/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 662ffed..e32e21a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -133,9 +133,11 @@ int main(int argc, char **argv) cout << "found " << std::to_string(found) << " devices" << endl; if (found > 1) { printError("Error: currently only one device is supported"); + delete(jtag); return EXIT_FAILURE; } else if (found < 1) { printError("Error: no device found"); + delete(jtag); return EXIT_FAILURE; }