diff --git a/resource/reapi/bindings/c/reapi_cli.cpp b/resource/reapi/bindings/c/reapi_cli.cpp index 0a95a4377..1d6fdf590 100644 --- a/resource/reapi/bindings/c/reapi_cli.cpp +++ b/resource/reapi/bindings/c/reapi_cli.cpp @@ -273,13 +273,8 @@ extern "C" int reapi_cli_stat (reapi_cli_ctx_t *ctx, extern "C" const char *reapi_cli_get_err_msg (reapi_cli_ctx_t *ctx) { std::string err_buf = ""; - - if (ctx->rqt) - err_buf = ctx->rqt->get_resource_query_err_msg () + reapi_cli_t::get_err_message () + err_buf = ctx->rqt->get_resource_query_err_msg () + reapi_cli_t::get_err_message () + ctx->err_msg; - else - err_buf = reapi_cli_t::get_err_message () + ctx->err_msg; - return strdup (err_buf.c_str ()); }