summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2017-01-23 14:03:11 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2017-01-23 14:03:11 +0200
commit588c225b3eb45872f7978c0d7e3d79cdd397a933 (patch)
treef9696e6f9c96093a1829a285242c1b69d271d367
parent3f1703cb95637b3ae0e319309cb6891e5b0d7434 (diff)
downloadmailutils-588c225b3eb45872f7978c0d7e3d79cdd397a933.tar.gz
mailutils-588c225b3eb45872f7978c0d7e3d79cdd397a933.tar.bz2
Fix memory allocation
-rw-r--r--imap4d/list.c5
-rw-r--r--mu/pop.c2
-rw-r--r--mu/smtp.c2
3 files changed, 4 insertions, 5 deletions
diff --git a/imap4d/list.c b/imap4d/list.c
index bf0c824e5..e69aa5527 100644
--- a/imap4d/list.c
+++ b/imap4d/list.c
@@ -121,9 +121,8 @@ list_ref (char const *ref, char const *wcard, char const *cwd,
rc = mu_folder_create (&folder, cwd);
if (rc)
- {
- return RESP_NO;
- }
+ return RESP_NO;
+
/* Force the right matcher */
mu_folder_set_match (folder, mu_folder_imap_match);
diff --git a/mu/pop.c b/mu/pop.c
index cf4d60f06..5f741aede 100644
--- a/mu/pop.c
+++ b/mu/pop.c
@@ -503,7 +503,7 @@ com_connect (int argc, char **argv)
else
{
connect_argc = argc;
- connect_argv = mu_calloc (argc, sizeof (*connect_argv));
+ connect_argv = mu_calloc (argc + 1, sizeof (*connect_argv));
for (i = 0; i < argc; i++)
connect_argv[i] = mu_strdup (argv[i]);
connect_argv[i] = NULL;
diff --git a/mu/smtp.c b/mu/smtp.c
index ab013f2b1..165e5c75c 100644
--- a/mu/smtp.c
+++ b/mu/smtp.c
@@ -237,7 +237,7 @@ com_connect (int argc, char **argv)
else
{
connect_argc = argc;
- connect_argv = mu_calloc (argc, sizeof (*connect_argv));
+ connect_argv = mu_calloc (argc + 1, sizeof (*connect_argv));
for (i = 0; i < argc; i++)
connect_argv[i] = mu_strdup (argv[i]);
connect_argv[i] = NULL;

Return to:

Send suggestions and report system problems to the System administrator.