summaryrefslogtreecommitdiff
path: root/libudev
diff options
context:
space:
mode:
authorFlorian Zumbiehl <florz@florz.de>2009-09-06 17:28:26 +0200
committerKay Sievers <kay.sievers@vrfy.org>2009-09-07 12:13:50 +0200
commit9e6273c713c5a4b4317decca33d2fba830562ff2 (patch)
tree06e596ea3f7eee42b2bf11bb284b58d25f9e9308 /libudev
parent6d837a5348e7b38cb122405290b7bc3c17d069aa (diff)
udev_queue_get_seqnum_sequence_is_finished(): fix possible file handle leak
Diffstat (limited to 'libudev')
-rw-r--r--libudev/libudev-queue.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libudev/libudev-queue.c b/libudev/libudev-queue.c
index 68efba0eee..f06c9e8a7a 100644
--- a/libudev/libudev-queue.c
+++ b/libudev/libudev-queue.c
@@ -360,10 +360,14 @@ int udev_queue_get_seqnum_sequence_is_finished(struct udev_queue *udev_queue,
return 1;
if (start < seqnum)
start = seqnum;
- if (start > end)
+ if (start > end) {
+ fclose(queue_file);
return 1;
- if (end - start > INT_MAX - 1)
+ }
+ if (end - start > INT_MAX - 1) {
+ fclose(queue_file);
return -EOVERFLOW;
+ }
unfinished = (end - start) + 1;
while (unfinished > 0) {