message_stream: Bugfix
* libmailutils/stream/message_stream.c (copy_trimmed_value): Fix memory allocation.
Showing
1 changed file
with
1 additions
and
1 deletions
... | @@ -138,7 +138,7 @@ copy_trimmed_value (const char *str) | ... | @@ -138,7 +138,7 @@ copy_trimmed_value (const char *str) |
138 | 138 | ||
139 | str = mu_str_skip_class (str, MU_CTYPE_SPACE); | 139 | str = mu_str_skip_class (str, MU_CTYPE_SPACE); |
140 | len = strlen (str) - 1; | 140 | len = strlen (str) - 1; |
141 | p = malloc (len); | 141 | p = malloc (len + 1); |
142 | memcpy (p, str, len); | 142 | memcpy (p, str, len); |
143 | p[len] = 0; | 143 | p[len] = 0; |
144 | return p; | 144 | return p; | ... | ... |
-
Please register or sign in to post a comment