Commit cf431d85 cf431d85b28662f883e1960f164579df8b01436e by Sergey Poznyakoff

message_stream: Bugfix

* libmailutils/stream/message_stream.c (copy_trimmed_value): Fix
memory allocation.
1 parent feee0bbf
...@@ -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;
......