From 9e6273c713c5a4b4317decca33d2fba830562ff2 Mon Sep 17 00:00:00 2001 From: Florian Zumbiehl Date: Sun, 6 Sep 2009 17:28:26 +0200 Subject: [PATCH] udev_queue_get_seqnum_sequence_is_finished(): fix possible file handle leak --- libudev/libudev-queue.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libudev/libudev-queue.c b/libudev/libudev-queue.c index 68efba0e..f06c9e8a 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) { -- 2.39.5