X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=sim%2Fo1-interface.git;a=blobdiff_plain;f=ntsimulator%2Fntsim-ng%2Fcore%2Fapp%2Fmanager_operations.c;h=e382b025af8992ed5eff5cf315f842962969f25f;hp=347c11de9f13fc259227cbb7d1e465f249365e17;hb=d57a3b4fb1fbc9b67862697a3cee82a94240b42f;hpb=c7070e211e10c8e43da0ee427a353180f2405b78 diff --git a/ntsimulator/ntsim-ng/core/app/manager_operations.c b/ntsimulator/ntsim-ng/core/app/manager_operations.c index 347c11d..e382b02 100644 --- a/ntsimulator/ntsim-ng/core/app/manager_operations.c +++ b/ntsimulator/ntsim-ng/core/app/manager_operations.c @@ -78,6 +78,7 @@ int manager_start_instance(manager_network_function_type *function_type) { free(instance->name); free(instance->mount_point_addressing_method); free(instance->host_ip); + function_type->started_instances--; return NTS_ERR_FAILED; } @@ -88,6 +89,7 @@ int manager_start_instance(manager_network_function_type *function_type) { free(instance->mount_point_addressing_method); free(instance->host_ip); manager_port[instance->host_port] = 0; + function_type->started_instances--; return NTS_ERR_FAILED; } @@ -202,7 +204,6 @@ int manager_stop_instance(manager_network_function_type *function_type) { if(instance->is_mounted) { if(manager_unmount_instance(function_type) != NTS_ERR_OK) { log_error("failed to unmount instance"); - return NTS_ERR_FAILED; } } @@ -330,6 +331,7 @@ int manager_mount_instance(manager_network_function_type *function_type) { int manager_unmount_instance(manager_network_function_type *function_type) { assert(function_type); + int ret = NTS_ERR_OK; manager_network_function_instance_t *instance = &function_type->instance[function_type->mounted_instances - 1]; @@ -361,10 +363,7 @@ int manager_unmount_instance(manager_network_function_type *function_type) { int rc = http_request(url, controller->username, controller->password, "DELETE", "", 0, 0); if(rc != NTS_ERR_OK) { log_error("http_request failed"); - free(url); - free(node_id); - controller_details_free(controller); - return NTS_ERR_FAILED; + ret = NTS_ERR_FAILED; } free(url); @@ -376,5 +375,5 @@ int manager_unmount_instance(manager_network_function_type *function_type) { function_type->mounted_instances--; function_type->instance[function_type->mounted_instances].is_mounted = false; - return NTS_ERR_OK; + return ret; }