(maildir_gethostname): Fixed a gross memory allocation bug.
Showing
1 changed file
with
2 additions
and
1 deletions
... | @@ -95,6 +95,7 @@ static struct info_map { | ... | @@ -95,6 +95,7 @@ static struct info_map { |
95 | }; | 95 | }; |
96 | #define info_map_size (sizeof (info_map) / sizeof (info_map[0])) | 96 | #define info_map_size (sizeof (info_map) / sizeof (info_map[0])) |
97 | 97 | ||
98 | /* FIXME: is not used */ | ||
98 | static int | 99 | static int |
99 | info_map_letter (int c) | 100 | info_map_letter (int c) |
100 | { | 101 | { |
... | @@ -200,7 +201,7 @@ maildir_gethostname () | ... | @@ -200,7 +201,7 @@ maildir_gethostname () |
200 | { | 201 | { |
201 | char *q; | 202 | char *q; |
202 | 203 | ||
203 | hp = malloc (strlen (hostname)) + s + 1; | 204 | hp = malloc (strlen (hostname) + s + 1); |
204 | for (p = hostname, q = hp; *p; p++) | 205 | for (p = hostname, q = hp; *p; p++) |
205 | switch (*p) | 206 | switch (*p) |
206 | { | 207 | { | ... | ... |
-
Please register or sign in to post a comment