Test fix for config loading crash

pull/90/head
Ivan Yartsev 2 years ago
parent 6e077aeb45
commit f0fe679ced

@ -574,7 +574,6 @@ int main(int argc, char *argv[]){
filters_init_flag();
control_event(widgets, &cfg_custom_gui);
yon_ubl_header_setup_resource(widgets->HeadOverlay,widgets->HeadBox,widgets->HeadImage,banner_path);
yon_ubl_status_box_setup(widgets->StatusIcon,widgets->StatusBox,widgets->StatusLabel);

@ -26,7 +26,7 @@ void load_template_load_cfg(config_all* _all_config, char* cmd) {
if (strstr(device, _config_disk->name_disk)) {
size_t deferring_size = 0;
size_t deferring_file = 0;
disk_status* disk_cfg = malloc(sizeof(disk_status));
disk_status* disk_cfg = g_malloc0(sizeof(disk_status));
disk_cfg->status = 1;
_all_config->v_disk_status.pfVectorAdd(&_all_config->v_disk_status, disk_cfg);
disk_cfg->device = yon_char_new(device);
@ -63,7 +63,7 @@ void load_template_load_cfg(config_all* _all_config, char* cmd) {
}
}
if (((strstr(str_value, "enable") || strstr(str_value, "disable")) || yon_char_find_count(str_key, ":") == 1) && flag_find == 0) {
disk_status* disk_cfg = malloc(sizeof(disk_status));
disk_status* disk_cfg = g_malloc0(sizeof(disk_status));
disk_cfg->deferring_size = 0;
disk_cfg->deferring_file = 0;
load_pars_values_status(disk_cfg, str_key, str_value);
@ -101,7 +101,7 @@ void load_template_load_cfg(config_all* _all_config, char* cmd) {
}
else {
config_u_g_p* _config = malloc(sizeof(config_u_g_p));
config_u_g_p* _config = g_malloc0(sizeof(config_u_g_p));
model_null_str_writing(_config);
_config->loaded_keys = yon_char_new(str_key);
load_pars_keys(_config, yon_char_new(str_key), index);

Loading…
Cancel
Save