[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.
This commit is contained in:
Ondrej Holy 2024-05-07 09:19:54 +02:00 committed by akallabeth
parent 702acc93c6
commit 9aca06e0b7
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5

View File

@ -825,11 +825,10 @@ 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;
}
}
WINPR_JSON* gateway_code_obj = WINPR_JSON_GetObjectItemCaseSensitive(json, "Code");
const char* gw_code_str = WINPR_JSON_GetStringValue(gateway_code_obj);