diff --git a/src/apps/debugger/debug_info/DwarfImageDebugInfo.cpp b/src/apps/debugger/debug_info/DwarfImageDebugInfo.cpp index 2e29311615..3f570c64e3 100644 --- a/src/apps/debugger/debug_info/DwarfImageDebugInfo.cpp +++ b/src/apps/debugger/debug_info/DwarfImageDebugInfo.cpp @@ -417,8 +417,15 @@ DwarfImageDebugInfo::GetType(GlobalTypeCache* cache, BReference fromDwarfMapReference(fromDwarfMap, true); // create the target interface - BasicTargetInterface inputInterface(registers, registerCount, fromDwarfMap, - fArchitecture, fTeamMemory); + BasicTargetInterface *inputInterface + = new(std::nothrow) BasicTargetInterface(registers, registerCount, + fromDwarfMap, fArchitecture, fTeamMemory); + + if (inputInterface == NULL) + return B_NO_MEMORY; + + BReference inputInterfaceReference(inputInterface, + true); // iterate through all compilation units for (int32 i = 0; CompilationUnit* unit = fFile->CompilationUnitAt(i); @@ -458,7 +465,7 @@ DwarfImageDebugInfo::GetType(GlobalTypeCache* cache, if (typeContext == NULL) { typeContext = new(std::nothrow) DwarfTypeContext(fArchitecture, fImageInfo.ImageID(), fFile, - unit, NULL, 0, 0, fRelocationDelta, &inputInterface, + unit, NULL, 0, 0, fRelocationDelta, inputInterface, fromDwarfMap); if (typeContext == NULL) return B_NO_MEMORY;