]> err.no Git - systemd/commitdiff
udev_queue_get_seqnum_sequence_is_finished(): fix possible file handle leak
authorFlorian Zumbiehl <florz@florz.de>
Sun, 6 Sep 2009 15:28:26 +0000 (17:28 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Mon, 7 Sep 2009 10:13:50 +0000 (12:13 +0200)
libudev/libudev-queue.c

index 68efba0eeee2bd246e7d975aaceae73d10b1154a..f06c9e8a7a3caaeced9653bc7678f50a2adb0fa5 100644 (file)
@@ -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) {