findmnt: fix resource leak [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2012-01-30 23:47:27 +01:00
parent 25609ee1be
commit d1cabd5ce5
1 changed files with 3 additions and 1 deletions

View File

@ -707,7 +707,7 @@ static int poll_match(struct libmnt_fs *fs)
static int poll_table(struct libmnt_table *tb, const char *tabfile,
int timeout, struct tt *tt, int direction)
{
FILE *f;
FILE *f = NULL;
int rc = -1;
struct libmnt_iter *itr = NULL;
struct libmnt_table *tb_new = NULL;
@ -807,6 +807,8 @@ done:
mnt_free_table(tb_new);
mnt_free_tabdiff(diff);
mnt_free_iter(itr);
if (f)
fclose(f);
return rc;
}