summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-08-05 15:43:39 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2019-08-05 15:43:39 +0200
commit4c6a9520effd885682dd2c296978311f5b54dd79 (patch)
treecac5ebe4c24e6333171ada4454d3d1058fdec1a1
parent4f50a9728dac505d901639cd29baa9f7b2eeb20f (diff)
eolian: fix use after free in eolian_database
'toscan' is actually a view to 'mpath' memory, so freeing it first would result in use-after-free. This is obviously only in the error branch so it usually does not happen, but fix anyway. CID1403022
-rw-r--r--src/lib/eolian/eolian_database.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/eolian/eolian_database.c b/src/lib/eolian/eolian_database.c
index 7e78a20105..5553616903 100644
--- a/src/lib/eolian/eolian_database.c
+++ b/src/lib/eolian/eolian_database.c
@@ -1104,8 +1104,8 @@ eolian_state_file_path_parse(Eolian_State *state, const char *filepath)
1104 1104
1105 if (!eolian_state_directory_add(state, toscan)) 1105 if (!eolian_state_directory_add(state, toscan))
1106 { 1106 {
1107 free(mpath);
1108 eolian_state_log(state, "could not scan directory '%s'", toscan); 1107 eolian_state_log(state, "could not scan directory '%s'", toscan);
1108 free(mpath);
1109 return NULL; 1109 return NULL;
1110 } 1110 }
1111 unit = eolian_state_file_parse(state, fname); 1111 unit = eolian_state_file_parse(state, fname);