summaryrefslogtreecommitdiff
path: root/dtrans/source/win32/misc/ImplHelper.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dtrans/source/win32/misc/ImplHelper.cxx')
-rw-r--r--dtrans/source/win32/misc/ImplHelper.cxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/dtrans/source/win32/misc/ImplHelper.cxx b/dtrans/source/win32/misc/ImplHelper.cxx
index df13e106e625..3c21d99a8efc 100644
--- a/dtrans/source/win32/misc/ImplHelper.cxx
+++ b/dtrans/source/win32/misc/ImplHelper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ImplHelper.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: tra $ $Date: 2001-03-15 06:56:03 $
+ * last change: $Author: tra $ $Date: 2001-03-15 08:10:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -234,16 +234,18 @@ void SAL_CALL DeleteTargetDevice( DVTARGETDEVICE* ptd )
DVTARGETDEVICE* SAL_CALL CopyTargetDevice( DVTARGETDEVICE* ptdSrc )
{
- DVTARGETDEVICE* ptdDest;
+ DVTARGETDEVICE* ptdDest = NULL;
__try
{
- ptdDest = static_cast< DVTARGETDEVICE* >( CoTaskMemAlloc( ptdSrc->tdSize ) );
- rtl_copyMemory( ptdDest, ptdSrc, static_cast< size_t >( ptdSrc->tdSize ) );
+ if ( NULL != ptdSrc )
+ {
+ ptdDest = static_cast< DVTARGETDEVICE* >( CoTaskMemAlloc( ptdSrc->tdSize ) );
+ rtl_copyMemory( ptdDest, ptdSrc, static_cast< size_t >( ptdSrc->tdSize ) );
+ }
}
__except( EXCEPTION_EXECUTE_HANDLER )
{
- ptdDest = NULL;
}
return ptdDest;