This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU Mailutils".
http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=76c508f88d9026915072af5ebb4055dc121154d5 The branch, master has been updated via 76c508f88d9026915072af5ebb4055dc121154d5 (commit) via 16ea05b703d50a78dc017ebf0d9355257dc6e8a2 (commit) from dbbf8dae0bdd56d108f8bfda7614b4a3b895eae2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 76c508f88d9026915072af5ebb4055dc121154d5 Author: Sergey Poznyakoff <g...@gnu.org.ua> Date: Wed Apr 14 20:34:10 2010 +0300 Fix indirect memory leak in mu_decode_filter. * include/mailutils/stream.h (mu_stream_clr_flags): New function. * mailbox/stream.c (mu_stream_clr_flags): New function. * mailbox/mapfile_stream.c (_mapfile_open): Avoid unnecessary boolean operation. * mailbox/mutil.c (mu_decode_filter): Use mu_stream_clr_flags to clear bits. commit 16ea05b703d50a78dc017ebf0d9355257dc6e8a2 Author: Sergey Poznyakoff <g...@gnu.org.ua> Date: Wed Apr 14 20:18:41 2010 +0300 Improve mu_mimehdr_a?get_disp. * mailbox/mimehdr.c (mu_mimehdr_get_disp) (mu_mimehdr_aget_disp): Return disposition even if no parameters have been given. ----------------------------------------------------------------------- Summary of changes: include/mailutils/stream.h | 1 + mailbox/mapfile_stream.c | 2 +- mailbox/mimehdr.c | 10 ++++++---- mailbox/mutil.c | 5 +---- mailbox/stream.c | 11 ++++++++++- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/include/mailutils/stream.h b/include/mailutils/stream.h index 59c8b25..9625dae 100644 --- a/include/mailutils/stream.h +++ b/include/mailutils/stream.h @@ -129,6 +129,7 @@ extern void mu_stream_set_owner (mu_stream_t, void* owner); extern int mu_stream_get_flags (mu_stream_t, int *pflags); extern int mu_stream_set_flags (mu_stream_t, int flags); +extern int mu_stream_clr_flags (mu_stream_t, int flags); extern int mu_stream_get_property (mu_stream_t, mu_property_t *); extern int mu_stream_set_property (mu_stream_t, mu_property_t, void *); diff --git a/mailbox/mapfile_stream.c b/mailbox/mapfile_stream.c index 29a6f06..e70d701 100644 --- a/mailbox/mapfile_stream.c +++ b/mailbox/mapfile_stream.c @@ -335,7 +335,7 @@ _mapfile_open (mu_stream_t stream) else mfs->ptr = NULL; mfs->flags = mflag; - mu_stream_set_flags (stream, flags |MU_STREAM_NO_CHECK); + mu_stream_set_flags (stream, MU_STREAM_NO_CHECK); return 0; } diff --git a/mailbox/mimehdr.c b/mailbox/mimehdr.c index cd38332..4c27358 100644 --- a/mailbox/mimehdr.c +++ b/mailbox/mimehdr.c @@ -338,8 +338,9 @@ mu_mimehdr_get_disp (const char *str, char *buf, size_t bufsz, size_t *retsz) size_t size; if (!p) - return MU_ERR_NOENT; - size = p - str; + size = strlen (str); + else + size = p - str; if (buf) size = mu_cpystr (buf, str, size); if (retsz) @@ -355,8 +356,9 @@ mu_mimehdr_aget_disp (const char *str, char **pvalue) size_t size; if (!p) - return MU_ERR_NOENT; - size = p - str; + size = strlen (str); + else + size = p - str; p = malloc (size + 1); if (!p) return ENOMEM; diff --git a/mailbox/mutil.c b/mailbox/mutil.c index 70bce58..656a31f 100644 --- a/mailbox/mutil.c +++ b/mailbox/mutil.c @@ -1337,10 +1337,7 @@ mu_decode_filter (mu_stream_t *pfilter, mu_stream_t input, mu_stream_destroy (&cvt, mu_stream_get_owner (cvt)); else { - int flags; - mu_stream_get_flags (cvt, &flags); - flags &= ~MU_STREAM_NO_CLOSE; - mu_stream_set_flags (cvt, flags); + mu_stream_clr_flags (cvt, MU_STREAM_NO_CLOSE); filter = cvt; } } diff --git a/mailbox/stream.c b/mailbox/stream.c index bdb44da..79a077a 100644 --- a/mailbox/stream.c +++ b/mailbox/stream.c @@ -80,7 +80,7 @@ mu_stream_destroy (mu_stream_t *pstream, void *owner) mu_stream_t stream = *pstream; if ((stream->flags & MU_STREAM_NO_CHECK) || stream->owner == owner) { - mu_stream_close(stream); + mu_stream_close (stream); if (stream->rbuffer.base) free (stream->rbuffer.base); @@ -815,6 +815,15 @@ mu_stream_set_flags (mu_stream_t stream, int fl) } int +mu_stream_clr_flags (mu_stream_t stream, int fl) +{ + if (stream == NULL) + return EINVAL; + stream->flags &= ~fl; + return 0; +} + +int mu_stream_set_strerror (mu_stream_t stream, int (*fp) (mu_stream_t, const char **), void *owner) { hooks/post-receive -- GNU Mailutils _______________________________________________ Commit-mailutils mailing list Commit-mailutils@gnu.org http://lists.gnu.org/mailman/listinfo/commit-mailutils