Skip to content

Commit

Permalink
Fix an issue identified by klockwork. (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
diptorupd authored May 27, 2021
1 parent b38750d commit 48794f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dpctl-capi/source/dpctl_sycl_platform_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@ __dpctl_give DPCTLSyclPlatformRef DPCTLPlatform_CreateFromSelector(
P = new platform(*DS);
PRef = wrap(P);
} catch (std::bad_alloc const &ba) {
delete P;
std::cerr << ba.what() << '\n';
return nullptr;
} catch (runtime_error const &re) {
delete P;
std::cerr << re.what() << '\n';
return nullptr;
}
}
else {
Expand Down

0 comments on commit 48794f7

Please sign in to comment.