1
1

Safe programming practice. Added va_end. (#425)

In file iperf_util.c:
Function 'va_start' is called at line:327. But, 'va_end' is not called before returning from function 'iperf_json_printf()' at line:352 and line:355. 
The va_end performs cleanup for the argp object initialized by a call to va_start. If va_end is not called before a function that calls va_start returns, the behavior is undefined.

Applied Fix: added va_end before returning from the function.
Этот коммит содержится в:
g-coder 2016-05-26 21:36:16 +05:30 коммит произвёл Bruce A. Mah
родитель 8fcfc2479f
Коммит 0da552c390

Просмотреть файл

@ -349,10 +349,13 @@ iperf_json_printf(const char *format, ...)
j = cJSON_CreateString(va_arg(argp, char *));
break;
default:
va_end(argp);
return NULL;
}
if (j == NULL)
return NULL;
if (j == NULL) {
va_end(argp);
return NULL;
}
cJSON_AddItemToObject(o, name, j);
np = name;
break;