src/hotspot/share/services/diagnosticArgument.cpp
changeset 58084 cddef3bde924
parent 53908 45a23c64d0f6
child 58682 9f5b92d5a1b2
--- a/src/hotspot/share/services/diagnosticArgument.cpp	Wed Sep 11 14:16:27 2019 +0200
+++ b/src/hotspot/share/services/diagnosticArgument.cpp	Wed Sep 11 14:16:30 2019 +0200
@@ -36,9 +36,7 @@
 
 StringArrayArgument::~StringArrayArgument() {
   for (int i=0; i<_array->length(); i++) {
-    if(_array->at(i) != NULL) { // Safety check
-      FREE_C_HEAP_ARRAY(char, _array->at(i));
-    }
+    FREE_C_HEAP_ARRAY(char, _array->at(i));
   }
   delete _array;
 }
@@ -197,10 +195,8 @@
 }
 
 template <> void DCmdArgument<char*>::destroy_value() {
-  if (_value != NULL) {
-    FREE_C_HEAP_ARRAY(char, _value);
-    set_value(NULL);
-  }
+  FREE_C_HEAP_ARRAY(char, _value);
+  set_value(NULL);
 }
 
 template <> void DCmdArgument<NanoTimeArgument>::parse_value(const char* str,