main: delete jtag if someone is wrong
This commit is contained in:
parent
4a3d1b3009
commit
050aa94b8b
|
|
@ -133,9 +133,11 @@ int main(int argc, char **argv)
|
||||||
cout << "found " << std::to_string(found) << " devices" << endl;
|
cout << "found " << std::to_string(found) << " devices" << endl;
|
||||||
if (found > 1) {
|
if (found > 1) {
|
||||||
printError("Error: currently only one device is supported");
|
printError("Error: currently only one device is supported");
|
||||||
|
delete(jtag);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
} else if (found < 1) {
|
} else if (found < 1) {
|
||||||
printError("Error: no device found");
|
printError("Error: no device found");
|
||||||
|
delete(jtag);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue