summaryrefslogtreecommitdiff
path: root/pop3d
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2012-03-25 18:02:18 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2012-03-25 18:02:18 +0300
commit177423b53793e3ad5dc6fd787f75b3ff4038aedf (patch)
tree3371b7fb1f2311412b0c8f1b76066e58a163559f /pop3d
parentbf4c4a43ac942d8d81d0d276fe15ae3217f0e5a9 (diff)
downloadmailutils-177423b53793e3ad5dc6fd787f75b3ff4038aedf.tar.gz
mailutils-177423b53793e3ad5dc6fd787f75b3ff4038aedf.tar.bz2
Revise some memory allocation routines.
* examples/aclck.c: Check return values from strdup. * libmailutils/base/usremail.c: Likewise. * libmailutils/mailbox/bodystruct.c: Likewise. * lib/mailcap.c: Likewise. * libmailutils/mailbox/mbx_default.c: Likewise. * libmailutils/server/acl.c: Likewise. * libmailutils/stream/logstream.c: Likewise. * libmailutils/stream/message_stream.c: Likewise. * libmu_argp/mu_argp.c: Likewise. * libmu_auth/ldap.c: Likewise. * libmu_auth/pam.c: Likewise. * libmu_auth/sql.c: Likewise. * libmu_sieve/comparator.c: Likewise. * libmu_sieve/conf.c: Likewise. * libmu_sieve/extensions/list.c: Likewise. * libmu_sieve/extensions/vacation.c: Likewise. * libproto/mailer/prog.c: Likewise. * libproto/mailer/smtp_io.c: Likewise. * maidag/lmtp.c: Likewise. * python/libmu_py/address.c: Likewise. * sql/odbc.c * examples/sfrom.c (main): Avoid unnecessary memory allocation. * libmailutils/mailbox/mailbox.c: Likewise. * frm/frm.h: Include mailutils/alloc.h, remove xalloc.h * mh/mh.h: Likewise. * imap4d/imap4d.h: Remove xalloc.h * mail/mail.h: Likewise. * mimeview/mimeview.h: Likewise. * mu/acl.c: Likewise. * readmsg/readmsg.c: Likewise. * include/mailutils/locker.h (mu_locker_set_default_external_program): Change returned type. * include/mailutils/mailbox.h (mu_set_folder_directory): Change returned type. * libmailutils/base/locker.c (mu_locker_set_default_external_program): Return int (error code). * libmailutils/base/tilde.c: Add extra checks * libmailutils/mime/mimehdr.c (_mime_header_parse): Bugfix. * mail/folders.c: Don't use alloca, use mu_alloc instead. It was the only use of that function in Mailutils, so this change allows to withdraw the alloca module. * gnulib.modules (alloca, malloc) (realloc, xalloc): Remove. * frm/common.c: Use mu_alloc and friends instead of xmalloc. * frm/from.c: Likewise. * imap4d/append.c: Likewise. * imap4d/auth_gsasl.c: Likewise. * imap4d/authenticate.c: Likewise. * imap4d/fetch.c: Likewise. * imap4d/imap4d.c: Likewise. * imap4d/io.c: Likewise. * imap4d/list.c: Likewise. * imap4d/namespace.c: Likewise. * imap4d/parsebuf.c: Likewise. * imap4d/preauth.c: Likewise. * imap4d/rename.c: Likewise. * imap4d/search.c: Likewise. * imap4d/util.c: Likewise. * libmu_argp/muinit.c: Likewise. * mail/alias.c: Likewise. * mail/alt.c: Likewise. * mail/copy.c: Likewise. * mail/decode.c: Likewise. * mail/escape.c: Likewise. * mail/file.c: Likewise. * mail/from.c: Likewise. * mail/mail.c: Likewise. * mail/mailline.c: Likewise * mail/mailvar.c: Likewise * mail/msgset.y: Likewise * mail/page.c: Likewise * mail/send.c: Likewise * mail/shell.c: Likewise * mail/unset.c: Likewise * mail/util.c: Likewise * mh/folder.c: Likewise * mh/mh_alias.l: Likewise * mh/mh_alias.y: Likewise * mh/mh_fmtgram.y: Likewise * mh/mh_format.c: Likewise * mh/mh_global.c: Likewise * mh/mh_init.c: Likewise * mh/mh_list.c: Likewise * mh/mh_whatnow.c: Likewise * mh/mh_whom.c: Likewise * mh/mhn.c: Likewise * mh/pick.y: Likewise * mh/prompter-rl.c: Likewise * mh/refile.c: Likewise * mh/repl.c: Likewise * mh/send.c: Likewise * mh/sortm.c: Likewise * mimeview/mimetypes.y: Likewise * mu/dbm.c: Likewise * mu/dispatch.c: Likewise * mu/imap.c: Likewise * mu/pop.c: Likewise * mu/shell.c: Likewise * pop3d/apop.c: Likewise * pop3d/bulletin.c: Likewise * pop3d/popauth.c: Likewise * pop3d/user.c: Likewise
Diffstat (limited to 'pop3d')
-rw-r--r--pop3d/apop.c2
-rw-r--r--pop3d/bulletin.c4
-rw-r--r--pop3d/popauth.c5
-rw-r--r--pop3d/user.c4
4 files changed, 6 insertions, 9 deletions
diff --git a/pop3d/apop.c b/pop3d/apop.c
index a4f4e122e..ee0508024 100644
--- a/pop3d/apop.c
+++ b/pop3d/apop.c
@@ -150,7 +150,7 @@ pop3d_apopuser (const char *user)
{
p = mu_str_skip_class (p + 1, MU_CTYPE_SPACE);
if (*p)
- password = strdup (p);
+ password = mu_strdup (p);
break;
}
}
diff --git a/pop3d/bulletin.c b/pop3d/bulletin.c
index a51cfff71..b49155e82 100644
--- a/pop3d/bulletin.c
+++ b/pop3d/bulletin.c
@@ -22,7 +22,7 @@ static char *bulletin_db_name;
void
set_bulletin_db (const char *file)
{
- bulletin_db_name = strdup (file);
+ bulletin_db_name = mu_strdup (file);
}
static void
@@ -65,7 +65,7 @@ open_bulletin_mailbox (mu_mailbox_t *pmbox)
int
set_bulletin_source (const char *source)
{
- bulletin_mbox_name = strdup (source);
+ bulletin_mbox_name = mu_strdup (source);
return 0;
}
diff --git a/pop3d/popauth.c b/pop3d/popauth.c
index 0e110ce8f..10f352462 100644
--- a/pop3d/popauth.c
+++ b/pop3d/popauth.c
@@ -16,7 +16,6 @@
along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. */
#include "pop3d.h"
-#include <xalloc.h>
#include "mailutils/libargp.h"
int db_list (char *input_name, char *output_name);
@@ -592,7 +591,7 @@ fill_pass (struct action_data *ap)
if (!p)
exit (EX_DATAERR);
- ap->passwd = strdup (p);
+ ap->passwd = mu_strdup (p);
/* TRANSLATORS: Please try to format this string so that it has
the same length as the translation of 'Password:' above */
rc = mu_getpass (in, out, _("Confirm :"), &p);
@@ -715,7 +714,7 @@ action_chpass (struct action_data *ap)
{
char *oldpass, *p;
- oldpass = xmalloc (contents.mu_dsize + 1);
+ oldpass = mu_alloc (contents.mu_dsize + 1);
memcpy (oldpass, contents.mu_dptr, contents.mu_dsize);
oldpass[contents.mu_dsize] = 0;
p = getpass (_("Old Password:"));
diff --git a/pop3d/user.c b/pop3d/user.c
index cc4a7994d..d68ab904e 100644
--- a/pop3d/user.c
+++ b/pop3d/user.c
@@ -49,9 +49,7 @@ pop3d_begin_session ()
return ERR_MBOX_LOCK;
}
- username = strdup (auth_data->name);
- if (username == NULL)
- pop3d_abquit (ERR_NO_MEM);
+ username = mu_strdup (auth_data->name);
state = TRANSACTION;
pop3d_outf ("+OK opened mailbox for %s\n", username);

Return to:

Send suggestions and report system problems to the System administrator.