diff options
author | Aleš Matěj <amatej@redhat.com> | 2021-05-13 12:12:36 +0300 |
---|---|---|
committer | Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com> | 2021-07-08 15:32:33 +0300 |
commit | 6c1cbe9f1641c0acb94e9cbc735834285e709764 (patch) | |
tree | 1e71a927b81751c22d741d0dce74499a1156053d | |
parent | 4b80475b69bcb499be07ddf545ad617cbfea7fc9 (diff) |
Don't free `file` so soon, this could lead to a deref after free
It is freed later outside the switch.
-rw-r--r-- | src/compression_wrapper.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/compression_wrapper.c b/src/compression_wrapper.c index 7275f06..69ffe8f 100644 --- a/src/compression_wrapper.c +++ b/src/compression_wrapper.c @@ -608,14 +608,12 @@ cr_sopen(const char *filename, zck_set_log_fd(STDOUT_FILENO); g_set_error(err, ERR_DOMAIN, CRE_IO, "%s", zck_get_error(zck)); - g_free(file); break; } } else { if (!file->FILE || !zck_init_read(zck, fd)) { g_set_error(err, ERR_DOMAIN, CRE_IO, "%s", zck_get_error(zck)); - g_free(file); break; } } |