main: delete jtag if someone is wrong

This commit is contained in:
Gwenhael Goavec-Merou 2020-08-19 15:15:37 +02:00
parent 4a3d1b3009
commit 050aa94b8b
1 changed files with 2 additions and 0 deletions

View File

@ -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;
}