From 233ed2076268ad6ca7d6cbf75cf2b2983408fa77 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Wed, 3 Aug 2005 07:55:16 +0000 Subject: allocate enough space for the url. May be related to #304461. 2005-08-02 Not Zed * mailing-list-actions.c (emla_list_action_do): allocate enough space for the url. May be related to #304461. svn path=/trunk/; revision=29964 --- plugins/mailing-list-actions/ChangeLog | 5 +++++ plugins/mailing-list-actions/mailing-list-actions.c | 9 +++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/plugins/mailing-list-actions/ChangeLog b/plugins/mailing-list-actions/ChangeLog index 87ccbbdae8..994c8e5419 100644 --- a/plugins/mailing-list-actions/ChangeLog +++ b/plugins/mailing-list-actions/ChangeLog @@ -1,3 +1,8 @@ +2005-08-02 Not Zed + + * mailing-list-actions.c (emla_list_action_do): allocate enough + space for the url. May be related to #304461. + 2005-05-16 Not Zed * mailing-list-actions.c: moved e-error to e-util diff --git a/plugins/mailing-list-actions/mailing-list-actions.c b/plugins/mailing-list-actions/mailing-list-actions.c index b1d0b79e9b..9bed95a76d 100644 --- a/plugins/mailing-list-actions/mailing-list-actions.c +++ b/plugins/mailing-list-actions/mailing-list-actions.c @@ -136,9 +136,7 @@ void emla_list_action_do (CamelFolder *folder, const char *uid, CamelMimeMessage } /* get URL portion */ - url = (char *) malloc (end - headerpos); - strncpy (url, headerpos, end - headerpos); - url[end-headerpos] = '\0'; + url = g_strndup(headerpos, end - headerpos); if (strncmp (url, "mailto:", 6) == 0) { if (emla_action_headers[t].interactive) @@ -165,7 +163,7 @@ void emla_list_action_do (CamelFolder *folder, const char *uid, CamelMimeMessage goto exit; g_error_free (err); } - free (url); + g_free (url); url = NULL; headerpos = end++; @@ -182,8 +180,7 @@ void emla_list_action_do (CamelFolder *folder, const char *uid, CamelMimeMessage exit: free (action_data->uri); free (action_data); - if (url) - free(url); + g_free(url); } void emla_list_help (EPlugin *item, EMMenuTargetSelect* sel) -- cgit v1.2.3