Skip to content

Commit f72927c

Browse files
committed
fixup! Fixed coverity in acl_hal_mmd.cpp: Resource leak (RESOURCE_LEAK)
1 parent aa1b484 commit f72927c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/acl_hal_mmd.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,10 +1207,8 @@ static std::optional<acl_mmd_library> get_msim_mmd_layer() {
12071207
#pragma warning(pop)
12081208
#endif
12091209

1210-
auto library = std::make_optional<acl_mmd_library>();
1211-
std::swap(library->ptr, mmd_lib);
1212-
library->dispatch = *mmd_dispatch;
1213-
return library;
1210+
return std::make_optional<acl_mmd_library>(
1211+
{std::move(mmd_lib), *mmd_dispatch});
12141212
}
12151213

12161214
ACL_HAL_EXPORT const acl_hal_t *

0 commit comments

Comments
 (0)