[warnings] fix integer narrowing

This commit is contained in:
akallabeth 2024-10-04 10:58:47 +02:00
parent 8f069b2be4
commit dceb15d14e
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5

View File

@ -781,13 +781,16 @@ void freerdp_addin_argv_free(ADDIN_ARGV* args)
ADDIN_ARGV* freerdp_addin_argv_new(size_t argc, const char* argv[])
{
if (argc > INT32_MAX)
return NULL;
ADDIN_ARGV* args = calloc(1, sizeof(ADDIN_ARGV));
if (!args)
return NULL;
if (argc == 0)
return args;
args->argc = argc;
args->argc = (int)argc;
args->argv = calloc(argc, sizeof(char*));
if (!args->argv)
goto fail;