mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
conf-parser: Initialize the state to zero immediately.
Set the state variable immediately to zero so if we fail to open the configuration file we don't check an uninitialized pointer and free an nonexistent proplist.
This commit is contained in:
parent
8239fca09f
commit
e9fd829877
1 changed files with 2 additions and 1 deletions
|
|
@ -163,6 +163,8 @@ int pa_config_parse(const char *filename, FILE *f, const pa_config_item *t, pa_p
|
|||
pa_assert(filename);
|
||||
pa_assert(t);
|
||||
|
||||
pa_zero(state);
|
||||
|
||||
if (!f && !(f = pa_fopen_cloexec(filename, "r"))) {
|
||||
if (errno == ENOENT) {
|
||||
pa_log_debug("Failed to open configuration file '%s': %s", filename, pa_cstrerror(errno));
|
||||
|
|
@ -174,7 +176,6 @@ int pa_config_parse(const char *filename, FILE *f, const pa_config_item *t, pa_p
|
|||
goto finish;
|
||||
}
|
||||
|
||||
pa_zero(state);
|
||||
state.filename = filename;
|
||||
state.item_table = t;
|
||||
state.userdata = userdata;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue