aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/AdItem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/wintermute/AdItem.cpp')
-rw-r--r--engines/wintermute/AdItem.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/engines/wintermute/AdItem.cpp b/engines/wintermute/AdItem.cpp
index b360f97e1d..3b78fa5507 100644
--- a/engines/wintermute/AdItem.cpp
+++ b/engines/wintermute/AdItem.cpp
@@ -700,8 +700,12 @@ HRESULT CAdItem::ScSetProperty(const char *Name, CScValue *Value) {
// AmountString
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AmountString") == 0) {
- if (Value->IsNULL()) SAFE_DELETE_ARRAY(_amountString);
- else CBUtils::SetString(&_amountString, Value->GetString());
+ if (Value->IsNULL()) {
+ delete[] _amountString;
+ _amountString = NULL;
+ } else {
+ CBUtils::SetString(&_amountString, Value->GetString());
+ }
return S_OK;
}