Commit 58f56b24 authored by Philip Withnall's avatar Philip Withnall

gkeyfile: Clear a variable after freeing it

find_file_in_data_dirs() doesn’t actually clear output_path to NULL on
failure, so this prevents a use-after-free on that (fd == -1) error
path.

Spotted by Coverity (CID: #1352981).
parent 7401dc1b
......@@ -970,6 +970,7 @@ g_key_file_load_from_dirs (GKeyFile *key_file,
while (*data_dirs != NULL && !found_file)
{
g_free (output_path);
output_path = NULL;
fd = find_file_in_data_dirs (file, data_dirs, &output_path,
&key_file_error);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment