Commit 588c225b 588c225b3eb45872f7978c0d7e3d79cdd397a933 by Sergey Poznyakoff

Fix memory allocation

1 parent 3f1703cb
...@@ -121,9 +121,8 @@ list_ref (char const *ref, char const *wcard, char const *cwd, ...@@ -121,9 +121,8 @@ list_ref (char const *ref, char const *wcard, char const *cwd,
121 121
122 rc = mu_folder_create (&folder, cwd); 122 rc = mu_folder_create (&folder, cwd);
123 if (rc) 123 if (rc)
124 {
125 return RESP_NO; 124 return RESP_NO;
126 } 125
127 /* Force the right matcher */ 126 /* Force the right matcher */
128 mu_folder_set_match (folder, mu_folder_imap_match); 127 mu_folder_set_match (folder, mu_folder_imap_match);
129 128
......
...@@ -503,7 +503,7 @@ com_connect (int argc, char **argv) ...@@ -503,7 +503,7 @@ com_connect (int argc, char **argv)
503 else 503 else
504 { 504 {
505 connect_argc = argc; 505 connect_argc = argc;
506 connect_argv = mu_calloc (argc, sizeof (*connect_argv)); 506 connect_argv = mu_calloc (argc + 1, sizeof (*connect_argv));
507 for (i = 0; i < argc; i++) 507 for (i = 0; i < argc; i++)
508 connect_argv[i] = mu_strdup (argv[i]); 508 connect_argv[i] = mu_strdup (argv[i]);
509 connect_argv[i] = NULL; 509 connect_argv[i] = NULL;
......
...@@ -237,7 +237,7 @@ com_connect (int argc, char **argv) ...@@ -237,7 +237,7 @@ com_connect (int argc, char **argv)
237 else 237 else
238 { 238 {
239 connect_argc = argc; 239 connect_argc = argc;
240 connect_argv = mu_calloc (argc, sizeof (*connect_argv)); 240 connect_argv = mu_calloc (argc + 1, sizeof (*connect_argv));
241 for (i = 0; i < argc; i++) 241 for (i = 0; i < argc; i++)
242 connect_argv[i] = mu_strdup (argv[i]); 242 connect_argv[i] = mu_strdup (argv[i]);
243 connect_argv[i] = NULL; 243 connect_argv[i] = NULL;
......