summaryrefslogtreecommitdiffstats
path: root/libmount/src/iter.c
diff options
context:
space:
mode:
authorKarel Zak2012-01-30 23:55:26 +0100
committerKarel Zak2012-01-30 23:55:26 +0100
commit0113a20e933c4ecf903db6fe8e442f6581d8bdba (patch)
tree03807015946f13c5f8231d583535c27fe05ac7b6 /libmount/src/iter.c
parentumount: (new) fix resource leak [coverity scan] (diff)
downloadkernel-qcow2-util-linux-0113a20e933c4ecf903db6fe8e442f6581d8bdba.tar.gz
kernel-qcow2-util-linux-0113a20e933c4ecf903db6fe8e442f6581d8bdba.tar.xz
kernel-qcow2-util-linux-0113a20e933c4ecf903db6fe8e442f6581d8bdba.zip
libmount: make iter reset more robust [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/iter.c')
-rw-r--r--libmount/src/iter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libmount/src/iter.c b/libmount/src/iter.c
index 99fedd17b..393c23eb2 100644
--- a/libmount/src/iter.c
+++ b/libmount/src/iter.c
@@ -56,7 +56,7 @@ void mnt_reset_iter(struct libmnt_iter *itr, int direction)
{
assert(itr);
- if (direction == -1)
+ if (direction == -1 && itr)
direction = itr->direction;
if (itr) {