Added a check for malloc fail.
Eventually we need to add a whole bunch more of these.
Этот коммит содержится в:
родитель
b70c54055f
Коммит
c8a0a2229d
@ -1363,6 +1363,11 @@ iperf_new_test()
|
||||
memset(test, 0, sizeof(struct iperf_test));
|
||||
|
||||
test->settings = (struct iperf_settings *) malloc(sizeof(struct iperf_settings));
|
||||
if (!test->settings) {
|
||||
free(test);
|
||||
i_errno = IENEWTEST;
|
||||
return NULL;
|
||||
}
|
||||
memset(test->settings, 0, sizeof(struct iperf_settings));
|
||||
|
||||
return test;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user