diff options
author | Jules Colding <jcolding@src.gnome.org> | 2007-05-11 19:55:57 +0800 |
---|---|---|
committer | Jules Colding <jcolding@src.gnome.org> | 2007-05-11 19:55:57 +0800 |
commit | c4d980042effc629e4caa36abe551874e5ef8226 (patch) | |
tree | 5f4baf19704f7e93eecdf23538d29f230f58b04d | |
parent | 9d237347078b5df54cbdc30d988a4b5253105cc1 (diff) | |
download | gsoc2013-evolution-c4d980042effc629e4caa36abe551874e5ef8226.tar.gz gsoc2013-evolution-c4d980042effc629e4caa36abe551874e5ef8226.tar.zst gsoc2013-evolution-c4d980042effc629e4caa36abe551874e5ef8226.zip |
Fix file descriptor leaks (#437664)
svn path=/trunk/; revision=33512
-rw-r--r-- | mail/ChangeLog | 4 | ||||
-rw-r--r-- | mail/mail-config.c | 2 | ||||
-rw-r--r-- | plugins/sa-junk-plugin/ChangeLog | 5 | ||||
-rw-r--r-- | plugins/sa-junk-plugin/em-junk-filter.c | 6 |
4 files changed, 17 insertions, 0 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 6b3e94ab85..23699ceaa5 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,7 @@ +2007-05-11 Jules Colding <colding@omesc.com> + + * mail-config.c (mail_config_signature_run_script): file descriptor leaks fixed + 2007-05-11 Srinivasa Ragavan <sragavan@novell.com> * GNOME_Evolution_Mail.server.in.in: Add Tango icons to preference diff --git a/mail/mail-config.c b/mail/mail-config.c index 60625d649f..a79b247196 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -1101,6 +1101,8 @@ mail_config_signature_run_script (const char *script) g_warning ("Could not execute %s: %s\n", script, g_strerror (errno)); _exit (255); } else if (pid < 0) { + close (in_fds [0]); + close (in_fds [1]); g_warning ("Failed to create create child process '%s': %s", script, g_strerror (errno)); return NULL; } else { diff --git a/plugins/sa-junk-plugin/ChangeLog b/plugins/sa-junk-plugin/ChangeLog index 9adab6f392..9cec485bdf 100644 --- a/plugins/sa-junk-plugin/ChangeLog +++ b/plugins/sa-junk-plugin/ChangeLog @@ -1,3 +1,8 @@ +2007-05-11 Jules Colding <colding@omesc.com> + + * em-junk-filter.c (pipe_to_sa_full): File descriptor leaks fixed. + Fixes bug #437664. + 2007-05-11 Gilles Dartiguelongue <dartigug@esiee.fr> * em-junk-filter.c: (pipe_to_sa_full), (em_junk_sa_check_junk), diff --git a/plugins/sa-junk-plugin/em-junk-filter.c b/plugins/sa-junk-plugin/em-junk-filter.c index e60a505bd5..0cf5ff6caa 100644 --- a/plugins/sa-junk-plugin/em-junk-filter.c +++ b/plugins/sa-junk-plugin/em-junk-filter.c @@ -143,6 +143,8 @@ pipe_to_sa_full (CamelMimeMessage *msg, const char *in, char **argv, int rv_err, } if (output_buffer && pipe (out_fds) == -1) { + close (fds [0]); + close (fds [1]); errnosav = errno; d(printf ("failed to create a pipe (for use with spamassassin: %s\n", strerror (errno))); errno = errnosav; @@ -176,6 +178,10 @@ pipe_to_sa_full (CamelMimeMessage *msg, const char *in, char **argv, int rv_err, errnosav = errno; close (fds[0]); close (fds[1]); + if (output_buffer) { + close (out_fds [0]); + close (out_fds [1]); + } errno = errnosav; return rv_err; } |