File 0001-fix-fd-leak.patch of Package openobex

From 6df3923e6a8cd82d5fe9d21801274f3d9f7f229d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= <crrodriguez@opensuse.org>
Date: Fri, 9 Oct 2009 20:08:10 -0400
Subject: [PATCH] fix fd leak
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit


Signed-off-by: Cristian Rodríguez <crrodriguez@opensuse.org>
---
 ircp/dirtraverse.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Index: openobex-1.5/ircp/dirtraverse.c
===================================================================
--- openobex-1.5.orig/ircp/dirtraverse.c
+++ openobex-1.5/ircp/dirtraverse.c
@@ -47,6 +47,7 @@ int visit_dir(char *path, visit_cb cb, v
 		else {
 			snprintf(t, MAXPATHLEN, "%s/%s", path, dirent->d_name);
 			if(lstat(t, &statbuf) < 0) {
+			    	closedir(dir);
 				return -1;
 			}
 			else if(S_ISREG(statbuf.st_mode)) {
@@ -76,6 +77,7 @@ int visit_dir(char *path, visit_cb cb, v
 	}
 
 out:
+	closedir(dir);
 	return ret;
 
 #else
openSUSE Build Service is sponsored by