Stumbled across this while working on const/warning revamp:

>From 1832f392f7fbcf3063b454da25da06f8e3334fb2 Mon Sep 17 00:00:00 2001
From: Jim Meyering <[email protected]>
Date: Fri, 27 Mar 2009 11:39:39 +0100
Subject: [PATCH] totemconfig: avoid a file descriptor leak in the common case

* exec/totemconfig.c (read_keyfile): Don't leak a file descriptor.
---
 exec/totemconfig.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/exec/totemconfig.c b/exec/totemconfig.c
index dde7593..f36e922 100644
--- a/exec/totemconfig.c
+++ b/exec/totemconfig.c
@@ -614,6 +614,7 @@ static int read_keyfile (
                         res * 8, key_location);
                goto parse_error;
        }
+       close (fd);
        return 0;

 parse_error:
--
1.6.2.rc1.285.gc5f54
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to