diff options
author | Karel Zak | 2018-07-25 11:56:44 +0200 |
---|---|---|
committer | Karel Zak | 2018-07-25 11:56:44 +0200 |
commit | 9c6af25c31540f8310bb6f4e6dbb5621b89053a3 (patch) | |
tree | b0e708ce7cafc1217567a9239d9edce6ac9af99c /sys-utils/losetup.c | |
parent | libblkid: use xstrncpy() for PT id [coverity scan] (diff) | |
download | kernel-qcow2-util-linux-9c6af25c31540f8310bb6f4e6dbb5621b89053a3.tar.gz kernel-qcow2-util-linux-9c6af25c31540f8310bb6f4e6dbb5621b89053a3.tar.xz kernel-qcow2-util-linux-9c6af25c31540f8310bb6f4e6dbb5621b89053a3.zip |
losetup: fix mem leak, improve code [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/losetup.c')
-rw-r--r-- | sys-utils/losetup.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys-utils/losetup.c b/sys-utils/losetup.c index 7525d8449..7d14f566c 100644 --- a/sys-utils/losetup.c +++ b/sys-utils/losetup.c @@ -141,8 +141,7 @@ static int printf_loopdev(struct loopdev_cxt *lc) if (loopcxt_get_sizelimit(lc, &x) == 0 && x) printf(_(", sizelimit %ju"), x); - printf("\n"); - return 0; + goto done; } printf("%s: [%04d]:%" PRIu64 " (%s)", @@ -162,6 +161,9 @@ static int printf_loopdev(struct loopdev_cxt *lc) if (e && *e) printf(_(", encryption %s (type %u)"), e, type); } + +done: + free(fname); printf("\n"); return 0; } |