projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace free() with mh_free0()
[mmh]
/
uip
/
folder.c
diff --git
a/uip/folder.c
b/uip/folder.c
index
77029dc
..
c8b3c60
100644
(file)
--- a/
uip/folder.c
+++ b/
uip/folder.c
@@
-263,7
+263,7
@@
main(int argc, char **argv)
}
for (cp = getcpy(getcurfol()); *ap; ap++)
cp = add(*ap, add(" ", cp));
}
for (cp = getcpy(getcurfol()); *ap; ap++)
cp = add(*ap, add(" ", cp));
- free(dp);
+ mh_free0(&dp);
context_replace(stack, cp); /* update folder stack */
} else {
/* update folder stack */
context_replace(stack, cp); /* update folder stack */
} else {
/* update folder stack */
@@
-294,7
+294,7
@@
main(int argc, char **argv)
/* delete folder stack entry from context */
context_del(stack);
}
/* delete folder stack entry from context */
context_del(stack);
}
- free(dp);
+ mh_free0(&dp);
}
if (pushsw || popsw) {
cp = toabsdir(argfolder);
}
if (pushsw || popsw) {
cp = toabsdir(argfolder);
@@
-313,7
+313,7
@@
main(int argc, char **argv)
dp = getcpy(cp);
for (ap = brkstring(dp, " ", "\n"); *ap; ap++)
printf(" %s", *ap);
dp = getcpy(cp);
for (ap = brkstring(dp, " ", "\n"); *ap; ap++)
printf(" %s", *ap);
- free(dp);
+ mh_free0(&dp);
}
printf("\n");
}
printf("\n");
@@
-324,21
+324,22
@@
main(int argc, char **argv)
/* Allocate initial space to record folder information */
maxFolderInfo = CRAWL_NUMFOLDERS;
/* Allocate initial space to record folder information */
maxFolderInfo = CRAWL_NUMFOLDERS;
- fi = mh_xmalloc(maxFolderInfo * sizeof(*fi));
+ fi = mh_xcalloc(maxFolderInfo, sizeof(*fi));
/*
** Scan the folders
*/
/*
** Scan the folders
*/
+ /*
+ ** change directory to base of nmh directory for
+ ** crawl_folders
+ */
+ if (chdir(nmhdir) == NOTOK) {
+ adios(EX_OSERR, nmhdir, "unable to change directory to");
+ }
if (all || ftotal > 0) {
/*
** If no folder is given, do them all
*/
if (all || ftotal > 0) {
/*
** If no folder is given, do them all
*/
- /*
- ** change directory to base of nmh directory for
- ** crawl_folders
- */
- if (chdir(nmhdir) == NOTOK)
- adios(EX_OSERR, nmhdir, "unable to change directory to");
if (!argfolder) {
if (msg)
admonish(NULL, "no folder given for message %s", msg);
if (!argfolder) {
if (msg)
admonish(NULL, "no folder given for message %s", msg);
@@
-630,7
+631,7
@@
readonly_folders(void)
{
int atrlen;
char atrcur[BUFSIZ];
{
int atrlen;
char atrcur[BUFSIZ];
- register struct node *np;
+ struct node *np;
snprintf(atrcur, sizeof(atrcur), "atr-%s-", seq_cur);
atrlen = strlen(atrcur);
snprintf(atrcur, sizeof(atrcur), "atr-%s-", seq_cur);
atrlen = strlen(atrcur);