[warnings] fix missing NULL assert/check
This commit is contained in:
parent
2ae0c456b4
commit
8a990644c0
@ -4558,6 +4558,7 @@ static int freerdp_client_settings_parse_command_line_arguments_int(
|
||||
}
|
||||
CommandLineSwitchCase(arg, "load-balance-info")
|
||||
{
|
||||
WINPR_ASSERT(arg->Value);
|
||||
if (!freerdp_settings_set_pointer_len(settings, FreeRDP_LoadBalanceInfo, arg->Value,
|
||||
strlen(arg->Value)))
|
||||
return fail_at(arg, COMMAND_LINE_ERROR);
|
||||
@ -4761,6 +4762,7 @@ static int freerdp_client_settings_parse_command_line_arguments_int(
|
||||
ConvertWCharNToUtf8(info.TimeZoneKeyName, ARRAYSIZE(info.TimeZoneKeyName),
|
||||
TimeZoneKeyName, ARRAYSIZE(TimeZoneKeyName));
|
||||
|
||||
WINPR_ASSERT(arg->Value);
|
||||
if (strncmp(TimeZoneKeyName, arg->Value, ARRAYSIZE(TimeZoneKeyName)) == 0)
|
||||
{
|
||||
found = TRUE;
|
||||
|
@ -44,7 +44,7 @@ int TestUri(int argc, char* argv[])
|
||||
const char* cmp = input[i + 1];
|
||||
int bTest = 0;
|
||||
char* name = parse_uri_to_local_file(in, strlen(in));
|
||||
if (name)
|
||||
if (name && cmp)
|
||||
{
|
||||
bTest = !strcmp(name, cmp);
|
||||
if (!bTest)
|
||||
|
@ -333,6 +333,10 @@ static BOOL copy(WCHAR** dst, ULONG* dstLen, const WCHAR* what, size_t len)
|
||||
*dst = NULL;
|
||||
*dstLen = 0;
|
||||
|
||||
if (!what && (len != 0))
|
||||
return FALSE;
|
||||
if (len == 0)
|
||||
return TRUE;
|
||||
*dst = calloc(sizeof(WCHAR), len + 1);
|
||||
if (!*dst)
|
||||
return FALSE;
|
||||
|
Loading…
Reference in New Issue
Block a user