hotspot/src/share/vm/runtime/globals.cpp
changeset 1404 4a969f79e3e6
parent 1388 3677f5f3d66b
parent 1402 ccb40ce62b79
child 4434 4b41e5b42f81
--- a/hotspot/src/share/vm/runtime/globals.cpp	Wed Sep 24 15:34:06 2008 -0400
+++ b/hotspot/src/share/vm/runtime/globals.cpp	Tue Sep 30 15:53:55 2008 -0700
@@ -365,8 +365,11 @@
   if (result == NULL) return false;
   if (!result->is_ccstr()) return false;
   ccstr old_value = result->get_ccstr();
-  char* new_value = NEW_C_HEAP_ARRAY(char, strlen(*value)+1);
-  strcpy(new_value, *value);
+  char* new_value = NULL;
+  if (*value != NULL) {
+    new_value = NEW_C_HEAP_ARRAY(char, strlen(*value)+1);
+    strcpy(new_value, *value);
+  }
   result->set_ccstr(new_value);
   if (result->origin == DEFAULT && old_value != NULL) {
     // Prior value is NOT heap allocated, but was a literal constant.