Fix some high-priority Coverity-catched defects
This commit is contained in:
parent
b3f50a3758
commit
1a55721c78
|
@ -1682,7 +1682,7 @@ static bool config_load_file(const char *path, bool set_defaults,
|
||||||
conf = open_default_config_file();
|
conf = open_default_config_file();
|
||||||
|
|
||||||
if (!conf)
|
if (!conf)
|
||||||
return true;
|
goto end;
|
||||||
|
|
||||||
if (set_defaults)
|
if (set_defaults)
|
||||||
config_set_defaults();
|
config_set_defaults();
|
||||||
|
@ -2111,7 +2111,9 @@ static bool config_load_file(const char *path, bool set_defaults,
|
||||||
config_read_keybinds_conf(conf);
|
config_read_keybinds_conf(conf);
|
||||||
|
|
||||||
|
|
||||||
config_file_free(conf);
|
end:
|
||||||
|
if (conf)
|
||||||
|
config_file_free(conf);
|
||||||
if (bool_settings)
|
if (bool_settings)
|
||||||
free(bool_settings);
|
free(bool_settings);
|
||||||
if (int_settings)
|
if (int_settings)
|
||||||
|
@ -3193,6 +3195,8 @@ bool config_save_overrides(int override_type)
|
||||||
if (path_overrides)
|
if (path_overrides)
|
||||||
free(path_overrides);
|
free(path_overrides);
|
||||||
free(settings);
|
free(settings);
|
||||||
|
if (conf)
|
||||||
|
config_file_free(conf);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -287,16 +287,16 @@ static int sevenzip_parse_file_init(file_archive_transfer_t *state,
|
||||||
(struct sevenzip_context_t*)sevenzip_stream_new();
|
(struct sevenzip_context_t*)sevenzip_stream_new();
|
||||||
|
|
||||||
if (state->archive_size < SEVENZIP_MAGIC_LEN)
|
if (state->archive_size < SEVENZIP_MAGIC_LEN)
|
||||||
return -1;
|
goto error;
|
||||||
|
|
||||||
if (memcmp(state->data, SEVENZIP_MAGIC, SEVENZIP_MAGIC_LEN) != 0)
|
if (memcmp(state->data, SEVENZIP_MAGIC, SEVENZIP_MAGIC_LEN) != 0)
|
||||||
return -1;
|
goto error;
|
||||||
|
|
||||||
state->stream = sevenzip_context;
|
state->stream = sevenzip_context;
|
||||||
|
|
||||||
/* could not open 7zip archive? */
|
/* could not open 7zip archive? */
|
||||||
if (InFile_Open(&sevenzip_context->archiveStream.file, file))
|
if (InFile_Open(&sevenzip_context->archiveStream.file, file))
|
||||||
return -1;
|
goto error;
|
||||||
|
|
||||||
FileInStream_CreateVTable(&sevenzip_context->archiveStream);
|
FileInStream_CreateVTable(&sevenzip_context->archiveStream);
|
||||||
LookToRead_CreateVTable(&sevenzip_context->lookStream, False);
|
LookToRead_CreateVTable(&sevenzip_context->lookStream, False);
|
||||||
|
@ -307,9 +307,14 @@ static int sevenzip_parse_file_init(file_archive_transfer_t *state,
|
||||||
|
|
||||||
if (SzArEx_Open(&sevenzip_context->db, &sevenzip_context->lookStream.s,
|
if (SzArEx_Open(&sevenzip_context->db, &sevenzip_context->lookStream.s,
|
||||||
&sevenzip_context->allocImp, &sevenzip_context->allocTempImp) != SZ_OK)
|
&sevenzip_context->allocImp, &sevenzip_context->allocTempImp) != SZ_OK)
|
||||||
return -1;
|
goto error;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
error:
|
||||||
|
if (sevenzip_context)
|
||||||
|
sevenzip_stream_free(sevenzip_context);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sevenzip_parse_file_iterate_step_internal(
|
static int sevenzip_parse_file_iterate_step_internal(
|
||||||
|
|
Loading…
Reference in New Issue