summaryrefslogtreecommitdiff
path: root/src/VBox/Devices/Serial/DrvRawFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/Devices/Serial/DrvRawFile.cpp')
-rw-r--r--src/VBox/Devices/Serial/DrvRawFile.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/VBox/Devices/Serial/DrvRawFile.cpp b/src/VBox/Devices/Serial/DrvRawFile.cpp
index 92d28408..0a9de209 100644
--- a/src/VBox/Devices/Serial/DrvRawFile.cpp
+++ b/src/VBox/Devices/Serial/DrvRawFile.cpp
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2006-2010 Oracle Corporation
+ * Copyright (C) 2006-2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -139,8 +139,11 @@ static DECLCALLBACK(void) drvRawFileDestruct(PPDMDRVINS pDrvIns)
if (pThis->pszLocation)
MMR3HeapFree(pThis->pszLocation);
- RTFileClose(pThis->hOutputFile);
- pThis->hOutputFile = NIL_RTFILE;
+ if (pThis->hOutputFile != NIL_RTFILE)
+ {
+ RTFileClose(pThis->hOutputFile);
+ pThis->hOutputFile = NIL_RTFILE;
+ }
}