Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/coverity fix #709

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions bundles/http_admin/http_admin/src/websocket_admin.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "websocket_admin.h"

#include "celix_compiler.h"
#include "celix_stdlib_cleanup.h"
#include "celix_utils_api.h"

struct websocket_admin_manager {
Expand All @@ -41,7 +42,7 @@ struct websocket_admin_manager {
websocket_admin_manager_t *websocketAdmin_create(celix_bundle_context_t *context, struct mg_context *svr_ctx) {
celix_status_t status;

websocket_admin_manager_t *admin = (websocket_admin_manager_t *) calloc(1, sizeof(websocket_admin_manager_t));
celix_autofree websocket_admin_manager_t *admin = (websocket_admin_manager_t *) calloc(1, sizeof(websocket_admin_manager_t));

if (admin == NULL) {
return NULL;
Expand All @@ -53,10 +54,10 @@ websocket_admin_manager_t *websocketAdmin_create(celix_bundle_context_t *context

if(status != CELIX_SUCCESS) {
//No need to destroy other things
free(admin);
return NULL;
}

return admin;
return celix_steal_ptr(admin);
}

void websocketAdmin_destroy(websocket_admin_manager_t *admin) {
Expand Down
7 changes: 0 additions & 7 deletions libs/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ if (UTILS)
src/version_range.c
src/properties.c
src/utils.c
src/ip_utils.c
src/filter.c
src/celix_log_level.c
src/celix_log_utils.c
Expand Down Expand Up @@ -157,19 +156,13 @@ if (UTILS)
target_include_directories(linked_list_test PRIVATE include_deprecated)
target_link_libraries(linked_list_test utils_cut CppUTest pthread)

add_executable(ip_utils_test private/test/ip_utils_test.cpp)
target_include_directories(ip_utils_test PRIVATE include_deprecated)
target_link_libraries(ip_utils_test CppUTest utils_cut pthread)

add_test(NAME run_array_list_test COMMAND array_list_test)
add_test(NAME run_hash_map_test COMMAND hash_map_test)
add_test(NAME run_linked_list_test COMMAND linked_list_test)
add_test(NAME run_ip_utils_test COMMAND ip_utils_test)

setup_target_for_coverage(hash_map_test)
setup_target_for_coverage(array_list_test)
setup_target_for_coverage(linked_list_test)
setup_target_for_coverage(ip_utils_test)
else ()
message(WARNING "Cannot find CppUTest, deprecated cpputest-based unit test will not be added")
endif () #end CppUTest_FOUND
Expand Down
1 change: 0 additions & 1 deletion libs/utils/gtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ if (EI_TESTS)
add_executable(test_utils_with_ei
src/FileUtilsErrorInjectionTestSuite.cc
src/ConvertUtilsErrorInjectionTestSuite.cc
src/IpUtilsErrorInjectionTestSuite.cc
src/ArrayListErrorInjectionTestSuite.cc
src/ErrErrorInjectionTestSuite.cc
src/PropertiesErrorInjectionTestSuite.cc
Expand Down
47 changes: 0 additions & 47 deletions libs/utils/gtest/src/IpUtilsErrorInjectionTestSuite.cc

This file was deleted.

52 changes: 0 additions & 52 deletions libs/utils/include_deprecated/ip_utils.h

This file was deleted.

108 changes: 0 additions & 108 deletions libs/utils/private/test/ip_utils_test.cpp

This file was deleted.

Loading
Loading