Skip to content

Commit b455e15

Browse files
authored
Fix Klocwork issues (#281)
* delete SyclProgram; * DynamicLibHelper operator= delete.
1 parent 8e526b4 commit b455e15

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
We use [clang-format](https://clang.llvm.org/docs/ClangFormat.html) code formatter.
88

9-
Install: `pip install clang`
9+
Install: `conda install clang-tools`
1010

1111
- Revision: `10.0.1`
1212
- See the default configuration used by dpCtl in `.clang-format`.

dpctl-capi/helper/include/dpctl_dynamic_lib_helper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ namespace dpctl
4646
class DynamicLibHelper final
4747
{
4848
public:
49+
DynamicLibHelper &operator=(const DynamicLibHelper &) = delete;
4950
DynamicLibHelper() = delete;
5051
DynamicLibHelper(const DynamicLibHelper &) = delete;
5152
DynamicLibHelper(const char *libName, int flag)

dpctl-capi/source/dpctl_sycl_program_interface.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,11 @@ DPCTLProgram_CreateFromOCLSource(__dpctl_keep const DPCTLSyclContextRef Ctx,
269269
break;
270270
case backend::level_zero:
271271
std::cerr << "CreateFromSource is not supported in Level Zero.\n";
272+
delete SyclProgram;
272273
return nullptr;
273274
default:
274275
std::cerr << "CreateFromSource is not supported in unknown backend.\n";
276+
delete SyclProgram;
275277
return nullptr;
276278
}
277279
}

0 commit comments

Comments
 (0)