From: Florian Zumbiehl Date: Sun, 6 Sep 2009 15:28:26 +0000 (+0200) Subject: udev_queue_get_seqnum_sequence_is_finished(): fix possible file handle leak X-Git-Tag: 174~787 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e6273c713c5a4b4317decca33d2fba830562ff2;p=systemd udev_queue_get_seqnum_sequence_is_finished(): fix possible file handle leak --- 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) {