Resolves-Coverity-CID: 1258794
Signed-off-by: David Sterba <dste...@suse.cz>
---
 btrfs-fragments.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/btrfs-fragments.c b/btrfs-fragments.c
index d03c2c3e7319..360f10f87bfa 100644
--- a/btrfs-fragments.c
+++ b/btrfs-fragments.c
@@ -233,7 +233,7 @@ list_fragments(int fd, u64 flags, char *dir)
                ret = ioctl(fd, BTRFS_IOC_TREE_SEARCH, &args);
                if (ret < 0) {
                        fprintf(stderr, "ERROR: can't perform the search\n");
-                       return ret;
+                       goto out_close;
                }
                /* the ioctl returns the number of item it found in nr_items */
                if (sk->nr_items == 0)
@@ -373,7 +373,10 @@ skip:;
                fprintf(html, "</p>");
        }
        fprintf(html, "</body></html>\n");
-       
+
+out_close:
+       fclose(html);
+
        return ret;
 }
 
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to