aboutsummaryrefslogtreecommitdiffstats
path: root/mail/importers/evolution-outlook-importer.c
diff options
context:
space:
mode:
authorJules Colding <jcolding@src.gnome.org>2007-05-29 17:06:58 +0800
committerJules Colding <jcolding@src.gnome.org>2007-05-29 17:06:58 +0800
commit1118857d92056b587950ea62feec07c4dde63e42 (patch)
tree0533f108b4291e46a7faf91c7df578d1f49c1ace /mail/importers/evolution-outlook-importer.c
parentd867b114fa56ed518b41bcdf2e6affe980e0ae10 (diff)
downloadgsoc2013-evolution-1118857d92056b587950ea62feec07c4dde63e42.tar
gsoc2013-evolution-1118857d92056b587950ea62feec07c4dde63e42.tar.gz
gsoc2013-evolution-1118857d92056b587950ea62feec07c4dde63e42.tar.bz2
gsoc2013-evolution-1118857d92056b587950ea62feec07c4dde63e42.tar.lz
gsoc2013-evolution-1118857d92056b587950ea62feec07c4dde63e42.tar.xz
gsoc2013-evolution-1118857d92056b587950ea62feec07c4dde63e42.tar.zst
gsoc2013-evolution-1118857d92056b587950ea62feec07c4dde63e42.zip
Fix file descriptor leaks
svn path=/trunk/; revision=33598
Diffstat (limited to 'mail/importers/evolution-outlook-importer.c')
-rw-r--r--mail/importers/evolution-outlook-importer.c4
1 files changed, 3 insertions, 1 deletions
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);
}