From 7a25a74cf911840224fb5b992d118c22c825f961 Mon Sep 17 00:00:00 2001 From: Chen Lihui Date: Thu, 28 Jan 2021 10:05:09 +0800 Subject: [PATCH] Avoid setting error message twice. (#887) Signed-off-by: Chen Lihui --- rcl_action/src/rcl_action/action_client.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rcl_action/src/rcl_action/action_client.c b/rcl_action/src/rcl_action/action_client.c index 58ab0a9a0..a03a61ec3 100644 --- a/rcl_action/src/rcl_action/action_client.c +++ b/rcl_action/src/rcl_action/action_client.c @@ -103,6 +103,7 @@ _rcl_action_client_fini_impl( char * Type ## _service_name = NULL; \ ret = rcl_action_get_ ## Type ## _service_name(action_name, allocator, &Type ## _service_name); \ if (RCL_RET_OK != ret) { \ + rcl_reset_error(); \ RCL_SET_ERROR_MSG("failed to get " #Type " service name"); \ if (RCL_RET_BAD_ALLOC == ret) { \ ret = RCL_RET_BAD_ALLOC; \ @@ -138,6 +139,7 @@ _rcl_action_client_fini_impl( char * Type ## _topic_name = NULL; \ ret = rcl_action_get_ ## Type ## _topic_name(action_name, allocator, &Type ## _topic_name); \ if (RCL_RET_OK != ret) { \ + rcl_reset_error(); \ RCL_SET_ERROR_MSG("failed to get " #Type " topic name"); \ if (RCL_RET_BAD_ALLOC == ret) { \ ret = RCL_RET_BAD_ALLOC; \