Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/gmime/internet-address.c b/gmime/internet-address.c
- index 194acff..d1467c3 100644
- --- a/gmime/internet-address.c
- +++ b/gmime/internet-address.c
- @@ -1632,15 +1632,19 @@ static gboolean
- addrspec_parse (const char **in, const char *sentinels, char **addrspec, int *at)
- {
- const char *inptr = *in;
- - GString *str;
- -
- - str = g_string_new ("");
- + static GString *str = NULL;
- +
- + if(str == NULL) {
- + str = g_string_new (NULL);
- + } else {
- + g_string_truncate (str, 0);
- + }
- if (!localpart_parse (str, &inptr))
- goto error;
- if (*inptr == '\0' || strchr (sentinels, *inptr)) {
- - *addrspec = g_string_free (str, FALSE);
- + *addrspec = g_strdup (str->str);
- *in = inptr;
- *at = -1;
- return TRUE;
- @@ -1664,13 +1668,12 @@ addrspec_parse (const char **in, const char *sentinels, char **addrspec, int *at
- if (!domain_parse (str, &inptr, sentinels))
- goto error;
- - *addrspec = g_string_free (str, FALSE);
- + *addrspec = g_strdup (str->str);
- *in = inptr;
- return TRUE;
- error:
- - g_string_free (str, TRUE);
- *addrspec = NULL;
- *in = inptr;
- *at = -1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement