File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
bundles/http_admin/http_admin/src Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 2727#include "websocket_admin.h"
2828
2929#include "celix_compiler.h"
30+ #include "celix_stdlib_cleanup.h"
3031#include "celix_utils_api.h"
3132
3233struct websocket_admin_manager {
@@ -41,7 +42,7 @@ struct websocket_admin_manager {
4142websocket_admin_manager_t * websocketAdmin_create (celix_bundle_context_t * context , struct mg_context * svr_ctx ) {
4243 celix_status_t status ;
4344
44- websocket_admin_manager_t * admin = (websocket_admin_manager_t * ) calloc (1 , sizeof (websocket_admin_manager_t ));
45+ celix_autofree websocket_admin_manager_t * admin = (websocket_admin_manager_t * ) calloc (1 , sizeof (websocket_admin_manager_t ));
4546
4647 if (admin == NULL ) {
4748 return NULL ;
@@ -53,10 +54,10 @@ websocket_admin_manager_t *websocketAdmin_create(celix_bundle_context_t *context
5354
5455 if (status != CELIX_SUCCESS ) {
5556 //No need to destroy other things
56- free ( admin ) ;
57+ return NULL ;
5758 }
5859
59- return admin ;
60+ return celix_steal_ptr ( admin ) ;
6061}
6162
6263void websocketAdmin_destroy (websocket_admin_manager_t * admin ) {
You can’t perform that action at this time.
0 commit comments