hotspot/src/share/vm/memory/allocation.cpp
changeset 33589 7cbd1b2c139b
parent 33105 294e48b4f704
child 34633 2a6c7c7b30a7
--- a/hotspot/src/share/vm/memory/allocation.cpp	Mon Oct 19 15:03:58 2015 +0200
+++ b/hotspot/src/share/vm/memory/allocation.cpp	Thu Oct 22 13:07:10 2015 -0400
@@ -66,7 +66,7 @@
 }
 
 void* ResourceObj::operator new(size_t size, allocation_type type, MEMFLAGS flags) throw() {
-  address res;
+  address res = NULL;
   switch (type) {
    case C_HEAP:
     res = (address)AllocateHeap(size, flags, CALLER_PC);
@@ -88,8 +88,8 @@
 
 void* ResourceObj::operator new(size_t size, const std::nothrow_t&  nothrow_constant,
     allocation_type type, MEMFLAGS flags) throw() {
-  //should only call this with std::nothrow, use other operator new() otherwise
-  address res;
+  // should only call this with std::nothrow, use other operator new() otherwise
+  address res = NULL;
   switch (type) {
    case C_HEAP:
     res = (address)AllocateHeap(size, flags, CALLER_PC, AllocFailStrategy::RETURN_NULL);