summaryrefslogtreecommitdiff
path: root/libudev/libudev-queue.c
diff options
context:
space:
mode:
Diffstat (limited to 'libudev/libudev-queue.c')
-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) {