From 9aca06e0b7916cd54fbc7a652e91c808330f081a Mon Sep 17 00:00:00 2001 From: Ondrej Holy Date: Tue, 7 May 2024 09:19:54 +0200 Subject: [PATCH] [core,gateway] always return in case of error Currently, the `arm_handle_bad_request` function returns `FALSE` when the `cJSON_ParseWithLength` function fails to parse the message, but only when the `cJSON_GetErrorPtr` returns a valid pointer. It would be better to return regardless of the `cJSON_GetErrorPtr` return value. --- libfreerdp/core/gateway/arm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libfreerdp/core/gateway/arm.c b/libfreerdp/core/gateway/arm.c index c2785ab7b..0dc7b925d 100644 --- a/libfreerdp/core/gateway/arm.c +++ b/libfreerdp/core/gateway/arm.c @@ -825,10 +825,9 @@ static BOOL arm_handle_bad_request(rdpArm* arm, const HttpResponse* response, BO { const char* error_ptr = WINPR_JSON_GetErrorPtr(); if (error_ptr != NULL) - { WLog_ERR(TAG, "NullPoException: %s", error_ptr); - return FALSE; - } + + return FALSE; } WINPR_JSON* gateway_code_obj = WINPR_JSON_GetObjectItemCaseSensitive(json, "Code");