The 'Codacy' tool reported that the scope of a local variable can be
reduced in the Debug() function of linuxDeployment.c.
Debug(const char *fmtstr, ...)
{
#ifdef VMX86_DEBUG
- va_list args;
-
char *tmp = malloc(MAXSTRING);
if (tmp != NULL) {
+ va_list args;
va_start(args, fmtstr);
Str_Vsnprintf(tmp, MAXSTRING, fmtstr, args);
va_end(args);
/*
* No Error check is employed since this is only an advisory service.
*/
- va_list args;
-
char* tmp = malloc(MAXSTRING);
if (tmp != NULL) {
+ va_list args;
va_start(args, format);
Str_Vsnprintf(tmp, MAXSTRING, format, args);
va_end(args);