diff options
author | Radovan Sroka <rsroka@redhat.com> | 2021-02-10 17:04:55 +0100 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2021-03-10 13:14:34 +0200 |
commit | 6d61b7118adcc14631b7ee5163a481472af940b8 (patch) | |
tree | a9f35699ddaa8dc3cfcb5deb862ca4ff2705fb30 /plugins | |
parent | 95a83332ac89e06708741e7074760981a417e64d (diff) | |
download | rpm-6d61b7118adcc14631b7ee5163a481472af940b8.tar.gz |
Fix resource leaks in fapolicyd plugin
Issues were found by coverity scan.
Signed-off-by: Radovan Sroka <rsroka@redhat.com>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/fapolicyd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/fapolicyd.c b/plugins/fapolicyd.c index 50f50155c..48f65ae11 100644 --- a/plugins/fapolicyd.c +++ b/plugins/fapolicyd.c @@ -58,7 +58,7 @@ static rpmRC open_fifo(struct fapolicyd_data* state) return RPMRC_OK; bad: - if (fd > 0) + if (fd >= 0) close(fd); return RPMRC_FAIL; } @@ -176,6 +176,8 @@ static rpmRC fapolicyd_fsm_file_prepare(rpmPlugin plugin, rpmfi fi, snprintf(buffer, 4096, "%s %lu %64s\n", dest, size, sha); (void) write_fifo(&fapolicyd_state, buffer); + free(sha); + end: return RPMRC_OK; } |