summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2002-11-07 15:02:08 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2002-11-07 15:02:08 +0000
commit0282f3bfc15a364aebaea91197df6b5e658d7d9a (patch)
treecde783008392ef0b933dcc9210efa530bc191321
parent0b2a01ec3faa87a106531e829d45447566b72de7 (diff)
downloadmailutils-0282f3bfc15a364aebaea91197df6b5e658d7d9a.tar.gz
mailutils-0282f3bfc15a364aebaea91197df6b5e658d7d9a.tar.bz2
Avoid unnecessary memory allocation.
-rw-r--r--mail.local/main.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/mail.local/main.c b/mail.local/main.c
index e1c9e6f3f..0429af579 100644
--- a/mail.local/main.c
+++ b/mail.local/main.c
@@ -261,7 +261,7 @@ switch_user_id (struct mu_auth_data *auth, int user)
int rc;
uid_t uid;
- if (auth->change_uid == 0)
+ if (!auth || auth->change_uid == 0)
return 0;
if (user)
@@ -375,22 +375,13 @@ deliver (FILE *fp, char *name)
return;
}
- path = strdup (auth->mailbox);
- if (!path)
+ if ((status = mailbox_create (&mbox, auth->mailbox)) != 0)
{
- mailer_err ("Out of memory");
+ mailer_err ("can't open mailbox %s: %s",
+ auth->mailbox, mu_errstring (status));
return;
}
- if ((status = mailbox_create (&mbox, path)) != 0)
- {
- mailer_err ("can't open mailbox %s: %s", path, mu_errstring (status));
- free (path);
- return;
- }
-
- free (path);
-
mailbox_get_url (mbox, &url);
path = (char*) url_to_string (url);

Return to:

Send suggestions and report system problems to the System administrator.