forked from osmocom/wireshark
Snort config: Avoid leaks when fail to open config file.
CID: 1477713
CID: 1477850
(cherry picked from commit bbcd42be87
)
This commit is contained in:
parent
bc38bea800
commit
aa0f0f65e7
|
@ -928,16 +928,15 @@ void create_config(SnortConfig_t **snort_config, const char *snort_config_file)
|
|||
if (config_file_fd == NULL) {
|
||||
snort_debug_printf("Failed to open config file %s\n", snort_config_file);
|
||||
report_failure("Snort dissector: Failed to open config file %s\n", snort_config_file);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Start parsing from the top-level config file. */
|
||||
parse_config_file(*snort_config, config_file_fd, snort_config_file, dirname, 1 /* recursion level */);
|
||||
else {
|
||||
/* Start parsing from the top-level config file. */
|
||||
parse_config_file(*snort_config, config_file_fd, snort_config_file, dirname, 1 /* recursion level */);
|
||||
fclose(config_file_fd);
|
||||
}
|
||||
|
||||
g_free(dirname);
|
||||
g_free(basename);
|
||||
|
||||
fclose(config_file_fd);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue