Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8262466: linux libsaproc/DwarfParser.cpp delete DwarfParser object in…
… early return

Reviewed-by: ysuenaga, kevinw
  • Loading branch information
MBaesken committed Mar 3, 2021
1 parent c15801e commit 0265ab63e4242a275aaf26199652f3f2a5e49bbf
Showing with 3 additions and 4 deletions.
  1. +3 −4 src/jdk.hotspot.agent/linux/native/libsaproc/DwarfParser.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, NTT DATA.
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2021, NTT DATA.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -99,14 +99,13 @@ JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_linux_amd64_DwarfParser_ini
extern "C"
JNIEXPORT jlong JNICALL Java_sun_jvm_hotspot_debugger_linux_amd64_DwarfParser_createDwarfContext
(JNIEnv *env, jclass this_cls, jlong lib) {
jlong result = 0L;

DwarfParser *parser = new DwarfParser(reinterpret_cast<lib_info *>(lib));
if (!parser->is_parseable()) {
jclass ex_cls = env->FindClass("sun/jvm/hotspot/debugger/DebuggerException");
if (!env->ExceptionOccurred()) {
env->ThrowNew(ex_cls, "DWARF not found");
}
delete parser;
return 0L;
}

0 comments on commit 0265ab6

Please sign in to comment.