[tracker/tracker-0.12] tracker-extract-pdf: Fix file descriptor leak in error cases



commit c2f1274f7af42e7d1d567e06d8c70f24638b7c29
Author: JÃrg Billeter <j bitron ch>
Date:   Tue Sep 27 16:46:44 2011 +0200

    tracker-extract-pdf: Fix file descriptor leak in error cases

 src/tracker-extract/tracker-extract-pdf.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-pdf.c b/src/tracker-extract/tracker-extract-pdf.c
index a884a10..af31369 100644
--- a/src/tracker-extract/tracker-extract-pdf.c
+++ b/src/tracker-extract/tracker-extract-pdf.c
@@ -363,6 +363,7 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
 
 			g_error_free (error);
 			g_free (uri);
+			close (fd);
 
 			return TRUE;
 		} else {
@@ -372,6 +373,7 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
 
 			g_error_free (error);
 			g_free (uri);
+			close (fd);
 
 			return FALSE;
 		}
@@ -382,6 +384,7 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
 		           "NULL returned without an error",
 		           uri);
 		g_free (uri);
+		close (fd);
 		return FALSE;
 	}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]