]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/win32/filed/plugins/storage_group_node.c
fix crash on exchange restore fail
[bacula/bacula] / bacula / src / win32 / filed / plugins / storage_group_node.c
index e2e45e6825396a3185fabef467c096cce90664b8..86043518821bdb18d42b3034f67fff8eab5fc3da 100644 (file)
@@ -456,6 +456,8 @@ storage_group_node_t::createFile(exchange_fd_context_t *context, struct restore_
          if (result != 0)
          {
             _JobMessage(M_ERROR, "HrESERestoreComplete failed with error 0x%08x - %s\n", result, ESEErrorMessage(result));
+            _DebugMessage(100, "Calling HrESERestoreClose\n");
+            result = HrESERestoreClose(hccx, RESTORE_CLOSE_NORMAL);
             state = 999;
             break;
          }
@@ -498,6 +500,7 @@ storage_group_node_t::endRestoreFile(exchange_fd_context_t *context)
       context->current_node = parent;
       return bRC_OK;
    case 999:
+      context->current_node = parent;
       return bRC_OK;
    }