Skip to content

Commit 32fa10b

Browse files
committed
Fix uinitialized scalar variablr 'ops' (CID436582)
1 parent f9e4dbc commit 32fa10b

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)