From 1118857d92056b587950ea62feec07c4dde63e42 Mon Sep 17 00:00:00 2001 From: Jules Colding Date: Tue, 29 May 2007 09:06:58 +0000 Subject: Fix file descriptor leaks svn path=/trunk/; revision=33598 --- mail/importers/evolution-outlook-importer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mail/importers/evolution-outlook-importer.c') diff --git a/mail/importers/evolution-outlook-importer.c b/mail/importers/evolution-outlook-importer.c index e9f1f64f86..5c63722feb 100644 --- a/mail/importers/evolution-outlook-importer.c +++ b/mail/importers/evolution-outlook-importer.c @@ -316,6 +316,7 @@ import_outlook_import(struct _mail_msg *mm) struct _import_outlook_msg *m = (struct _import_outlook_msg *) mm; struct stat st; CamelFolder *folder; + int fd = -1; if (stat(m->path, &st) == -1) { g_warning("cannot find source file to import '%s': %s", m->path, g_strerror(errno)); @@ -334,7 +335,6 @@ import_outlook_import(struct _mail_msg *mm) CamelOperation *oldcancel = NULL; CamelMessageInfo *info; GByteArray *buffer; - int fd; off_t pos; fd = g_open(m->path, O_RDONLY|O_BINARY, 0); @@ -413,6 +413,8 @@ import_outlook_import(struct _mail_msg *mm) g_byte_array_free(buffer, TRUE); } fail: + if (fd != -1) + close(fd); camel_object_unref(folder); } -- cgit v1.2.3