From f5a64d8e9d6c205ea62e164517bb913604e8d8e9 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Fri, 16 Apr 2010 13:12:23 +0000 Subject: [PATCH] 2010-04-16 Ramon Novoa * windows/pandora_wmi.cc: fixed getOSVersion. Crashed in Windows 2008 and Windows 7. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2572 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_agents/win32/ChangeLog | 5 +++++ pandora_agents/win32/windows/pandora_wmi.cc | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pandora_agents/win32/ChangeLog b/pandora_agents/win32/ChangeLog index 5bb1689bef..f816b01f69 100644 --- a/pandora_agents/win32/ChangeLog +++ b/pandora_agents/win32/ChangeLog @@ -1,3 +1,8 @@ +2010-04-16 Ramon Novoa + + * windows/pandora_wmi.cc: fixed getOSVersion. Crashed in Windows 2008 + and Windows 7. + 2009-12-18 Ramon Novoa * windows/pandora_wmi.cc: Fixed bug #2907481. diff --git a/pandora_agents/win32/windows/pandora_wmi.cc b/pandora_agents/win32/windows/pandora_wmi.cc index 75ae7315b0..84345e009b 100644 --- a/pandora_agents/win32/windows/pandora_wmi.cc +++ b/pandora_agents/win32/windows/pandora_wmi.cc @@ -400,9 +400,10 @@ Pandora_Wmi::getOSVersion () { dhGetValue (L"%s", &version, quickfix, L".CSDVersion"); - ret = version; - dhFreeString (version); - + if (version != NULL) { + ret = version; + dhFreeString (version); + } } NEXT_THROW (quickfix); } catch (string errstr) { pandoraLog ("getOSVersion error. %s", errstr.c_str ());