harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r486309 - /harmony/enhanced/drlvm/trunk/vm/vmi/src/vmi.cpp
Date Tue, 12 Dec 2006 21:01:30 GMT
Author: gshimansky
Date: Tue Dec 12 13:01:26 2006
New Revision: 486309

URL: http://svn.apache.org/viewvc?view=rev&rev=486309
Log:
Fix to changes in classlib in r486100, do not call strdup if property value
cannot be found


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmi/src/vmi.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmi/src/vmi.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmi/src/vmi.cpp?view=diff&rev=486309&r1=486308&r2=486309
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmi/src/vmi.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmi/src/vmi.cpp Tue Dec 12 13:01:26 2006
@@ -147,9 +147,17 @@
 GetSystemProperty(VMInterface *vmi, char *key, char **valuePtr)
 {
     char* value = get_property(key, JAVA_PROPERTIES);
-    *valuePtr = strdup(value);
-    destroy_property_value(value);
-    return VMI_ERROR_NONE;
+    if (NULL != value)
+    {
+        *valuePtr = strdup(value);
+        destroy_property_value(value);
+        return VMI_ERROR_NONE;
+    }
+    else
+    {
+        *valuePtr = NULL;
+        return VMI_ERROR_NOT_FOUND;
+    }
 }
 
 vmiError JNICALL



Mime
View raw message