bugfix: tools: close session on failure
If we fail to upload the contents, close the session.
Change-Id: I02d8112a52ecc6c4bd19279b5a6e67e1533b5ddc
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/tools/updater.cpp b/tools/updater.cpp
index 27414c1..0c45d7b 100644
--- a/tools/updater.cpp
+++ b/tools/updater.cpp
@@ -89,6 +89,10 @@
/* Send over the firmware image. */
if (!handler->sendContents(imagePath, session))
{
+ /* Need to close the session on failure, or it's stuck open (until the
+ * blob handler timeout is implemented, and even then, why make it wait.
+ */
+ blob->closeBlob(session);
throw ToolException("Failed to send contents of " + imagePath);
}