xfs
[Top] [All Lists]

[PATCH 6/6] xfs_db: free flist on error in write_struct()

To: xfs@xxxxxxxxxxx
Subject: [PATCH 6/6] xfs_db: free flist on error in write_struct()
From: Eric Sandeen <sandeen@xxxxxxxxxx>
Date: Fri, 1 Aug 2014 09:59:19 -0500
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1406905159-12415-1-git-send-email-sandeen@xxxxxxxxxx>
References: <1406905159-12415-1-git-send-email-sandeen@xxxxxxxxxx>
One error path in write_struct() wasn't freeing
the flist_t *fl which was allocated, so it leaks.

Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
---
 db/write.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/db/write.c b/db/write.c
index 0157a44..a0f14f4 100644
--- a/db/write.c
+++ b/db/write.c
@@ -652,6 +652,7 @@ write_struct(
        buf = convert_arg(argv[1], bit_length);
        if (!buf) {
                dbprintf(_("unable to convert value '%s'.\n"), argv[1]);
+               flist_free(fl);
                return;
        }
 
-- 
1.7.1

<Prev in Thread] Current Thread [Next in Thread>