Skip to content

Commit ffd3400

Browse files
authored
Merge pull request #284 from szadam/CID436582
Fix: uninitialized scalar variable 'ops'
2 parents f31ad4e + f748b33 commit ffd3400

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/cpp_helpers.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ umf_result_t initialize(T *obj, ArgsTuple &&args) {
6666
}
6767

6868
template <typename T> umf_memory_pool_ops_t poolOpsBase() {
69-
umf_memory_pool_ops_t ops;
69+
umf_memory_pool_ops_t ops{};
7070
ops.version = UMF_VERSION_CURRENT;
7171
ops.finalize = [](void *obj) { delete reinterpret_cast<T *>(obj); };
7272
UMF_ASSIGN_OP(ops, T, malloc, ((void *)nullptr));
@@ -80,7 +80,7 @@ template <typename T> umf_memory_pool_ops_t poolOpsBase() {
8080
}
8181

8282
template <typename T> umf_memory_provider_ops_t providerOpsBase() {
83-
umf_memory_provider_ops_t ops;
83+
umf_memory_provider_ops_t ops{};
8484
ops.version = UMF_VERSION_CURRENT;
8585
ops.finalize = [](void *obj) { delete reinterpret_cast<T *>(obj); };
8686
UMF_ASSIGN_OP(ops, T, alloc, UMF_RESULT_ERROR_UNKNOWN);

0 commit comments

Comments
 (0)