summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>2002-12-10 20:56:47 +0000
committerThomas Roessler <roessler@does-not-exist.org>2002-12-10 20:56:47 +0000
commitb62866d93e48a510912a1f503d907a2320da9238 (patch)
tree807a4c446cbec93779394a22cbc645430c8c94b1
parentcd96c3449e02199afe9cde511f128bb387f5f4d3 (diff)
Replace safe_free calls by the FREE macro.
-rw-r--r--addrbook.c2
-rw-r--r--alias.c2
-rw-r--r--attach.c8
-rw-r--r--browser.c18
-rw-r--r--buffy.c8
-rw-r--r--charset.c4
-rw-r--r--color.c8
-rw-r--r--compose.c28
-rw-r--r--copy.c4
-rw-r--r--crypt.c2
-rw-r--r--curs_main.c8
-rw-r--r--enter.c8
-rw-r--r--gnupgparse.c2
-rw-r--r--hash.c6
-rw-r--r--history.c4
-rw-r--r--hook.c2
-rw-r--r--imap/command.c2
-rw-r--r--imap/imap.c4
-rw-r--r--imap/message.c4
-rw-r--r--imap/utf7.c10
-rw-r--r--imap/util.c4
-rw-r--r--init.c10
-rw-r--r--lib.c4
-rw-r--r--main.c4
-rw-r--r--mbox.c16
-rw-r--r--menu.c8
-rw-r--r--mh.c18
-rw-r--r--mutt_ssl.c2
-rw-r--r--mutt_ssl_nss.c4
-rw-r--r--muttlib.c50
-rw-r--r--mx.c12
-rw-r--r--pager.c20
-rw-r--r--parse.c6
-rw-r--r--pattern.c8
-rw-r--r--pgp.c6
-rw-r--r--pgpkey.c4
-rw-r--r--pgplib.c10
-rw-r--r--pgppacket.c2
-rw-r--r--pgppubring.c6
-rw-r--r--pop.c2
-rw-r--r--pop_auth.c2
-rw-r--r--postpone.c12
-rw-r--r--query.c18
-rw-r--r--recvattach.c6
-rw-r--r--remailer.c14
-rw-r--r--rfc1524.c32
-rw-r--r--rfc2047.c28
-rw-r--r--rfc2231.c16
-rw-r--r--rfc822.c2
-rw-r--r--score.c4
-rw-r--r--send.c2
-rw-r--r--sendlib.c36
-rw-r--r--smime.c22
-rw-r--r--thread.c10
-rw-r--r--url.c2
55 files changed, 268 insertions, 268 deletions
diff --git a/addrbook.c b/addrbook.c
index cbc11c14..6a5036f5 100644
--- a/addrbook.c
+++ b/addrbook.c
@@ -231,6 +231,6 @@ new_aliases:
rfc822_write_address (buf, buflen, AliasTable[t]->addr);
mutt_menuDestroy (&menu);
- safe_free ((void **) &AliasTable);
+ FREE (&AliasTable);
}
diff --git a/alias.c b/alias.c
index b31e9b5e..5e551918 100644
--- a/alias.c
+++ b/alias.c
@@ -469,7 +469,7 @@ int mutt_alias_complete (char *s, size_t buflen)
{
a_cur = a_list;
a_list = a_list->next;
- safe_free ((void **) &a_cur);
+ FREE (&a_cur);
}
/* remove any aliases marked for deletion */
diff --git a/attach.c b/attach.c
index 4e9bf5e6..171929a4 100644
--- a/attach.c
+++ b/attach.c
@@ -156,13 +156,13 @@ int mutt_compose_attachment (BODY *a)
b->parameter = NULL;
}
if (b->description) {
- safe_free ((void **) &a->description);
+ FREE (&a->description);
a->description = b->description;
b->description = NULL;
}
if (b->form_name)
{
- safe_free ((void **) &a->form_name);
+ FREE (&a->form_name);
a->form_name = b->form_name;
b->form_name = NULL;
}
@@ -356,9 +356,9 @@ void mutt_check_lookup_list (BODY *b, char *type, int len)
b->filename, type));
}
if (tmp.subtype)
- safe_free ((void **) &tmp.subtype);
+ FREE (&tmp.subtype);
if (tmp.xtype)
- safe_free ((void **) &tmp.xtype);
+ FREE (&tmp.xtype);
}
}
}
diff --git a/browser.c b/browser.c
index 34778ac2..61fe713a 100644
--- a/browser.c
+++ b/browser.c
@@ -60,14 +60,14 @@ static void destroy_state (struct browser_state *state)
for (c = 0; c < state->entrylen; c++)
{
- safe_free ((void **) &((state->entry)[c].name));
- safe_free ((void **) &((state->entry)[c].desc));
- safe_free ((void **) &((state->entry)[c].st));
+ FREE (&((state->entry)[c].name));
+ FREE (&((state->entry)[c].desc));
+ FREE (&((state->entry)[c].st));
}
#ifdef USE_IMAP
- safe_free ((void **) &state->folder);
+ FREE (&state->folder);
#endif
- safe_free ((void **) &state->entry);
+ FREE (&state->entry);
}
static int browser_compare_subject (const void *a, const void *b)
@@ -889,8 +889,8 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num
if (!imap_delete_mailbox (Context, mx))
{
/* free the mailbox from the browser */
- safe_free ((void **) &((state.entry)[nentry].name));
- safe_free ((void **) &((state.entry)[nentry].desc));
+ FREE (&((state.entry)[nentry].name));
+ FREE (&((state.entry)[nentry].desc));
/* and move all other entries up */
if (nentry+1 < state.entrylen)
memmove (state.entry + nentry, state.entry + nentry + 1,
@@ -995,14 +995,14 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num
{
regerror (err, rx, buf, sizeof (buf));
regfree (rx);
- safe_free ((void **) &rx);
+ FREE (&rx);
mutt_error ("%s", buf);
}
else
{
mutt_str_replace (&Mask.pattern, buf);
regfree (Mask.rx);
- safe_free ((void **) &Mask.rx);
+ FREE (&Mask.rx);
Mask.rx = rx;
Mask.not = not;
diff --git a/buffy.c b/buffy.c
index ac740044..e0ef5d2f 100644
--- a/buffy.c
+++ b/buffy.c
@@ -179,9 +179,9 @@ int mutt_parse_mailboxes (BUFFER *path, BUFFER *s, unsigned long data, BUFFER *e
{
for (tmp = &Incoming; *tmp;)
{
- safe_free((void **)&((*tmp)->path));
+ FREE (&((*tmp)->path));
tmp1=(*tmp)->next;
- safe_free((void **)tmp);
+ FREE (tmp);
*tmp=tmp1;
}
return 0;
@@ -203,9 +203,9 @@ int mutt_parse_mailboxes (BUFFER *path, BUFFER *s, unsigned long data, BUFFER *e
{
if(*tmp)
{
- safe_free((void **)&((*tmp)->path));
+ FREE (&((*tmp)->path));
tmp1=(*tmp)->next;
- safe_free((void **)tmp);
+ FREE (tmp);
*tmp=tmp1;
}
continue;
diff --git a/charset.c b/charset.c
index 86e7a3c7..65afc9e3 100644
--- a/charset.c
+++ b/charset.c
@@ -440,7 +440,7 @@ int mutt_convert_string (char **ps, const char *from, const char *to, int flags)
*ob = '\0';
- safe_free ((void **) ps);
+ FREE (ps);
*ps = buf;
mutt_str_adjust (ps);
@@ -579,5 +579,5 @@ void fgetconv_close (FGETCONV **_fc)
if (fc->cd != (iconv_t)-1)
iconv_close (fc->cd);
- safe_free ((void **) _fc);
+ FREE (_fc);
}
diff --git a/color.c b/color.c
index 7a31588d..2265730a 100644
--- a/color.c
+++ b/color.c
@@ -124,8 +124,8 @@ static void mutt_free_color_line(COLOR_LINE **l,
regfree(&tmp->rx);
mutt_pattern_free(&tmp->color_pattern);
- safe_free((void **)&tmp->pattern);
- safe_free((void **)l);
+ FREE (&tmp->pattern);
+ FREE (l);
}
void ci_start_color (void)
@@ -275,7 +275,7 @@ void mutt_free_color (int fg, int bg)
if (p == ColorList)
{
ColorList = ColorList->next;
- safe_free ((void **) &p);
+ FREE (&p);
return;
}
q = ColorList;
@@ -284,7 +284,7 @@ void mutt_free_color (int fg, int bg)
if (q->next == p)
{
q->next = p->next;
- safe_free ((void **) &p);
+ FREE (&p);
return;
}
q = q->next;
diff --git a/compose.c b/compose.c
index 8b28c813..22881d0d 100644
--- a/compose.c
+++ b/compose.c
@@ -463,8 +463,8 @@ static int delete_attachment (MUTTMENU *menu, short *idxlen, int x)
idx[x]->content->next = NULL;
idx[x]->content->parts = NULL;
mutt_free_body (&(idx[x]->content));
- safe_free ((void **) &idx[x]->tree);
- safe_free ((void **) &idx[x]);
+ FREE (&idx[x]->tree);
+ FREE (&idx[x]);
for (; x < *idxlen - 1; x++)
idx[x] = idx[x+1];
menu->max = --(*idxlen);
@@ -723,7 +723,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
if (idxlen && idx[idxlen - 1]->content->next)
{
for (i = 0; i < idxlen; i++)
- safe_free ((void **) &idx[i]);
+ FREE (&idx[i]);
idxlen = 0;
idx = mutt_gen_attach_list (msg->content, -1, idx, &idxlen, &idxmax, 0, 1);
menu->data = idx;
@@ -758,7 +758,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
menu->redraw |= REDRAW_INDEX;
}
else
- safe_free ((void **) &idx[idxlen]);
+ FREE (&idx[idxlen]);
menu->redraw |= REDRAW_STATUS;
@@ -807,7 +807,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
{
error = 1;
mutt_error (_("Unable to attach %s!"), att);
- safe_free ((void **) &idx[idxlen]);
+ FREE (&idx[idxlen]);
}
}
@@ -861,7 +861,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
if (!ctx->msgcount)
{
mx_close_mailbox (ctx, NULL);
- safe_free ((void **) &ctx);
+ FREE (&ctx);
mutt_error _("No messages in that folder.");
break;
}
@@ -904,7 +904,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
else
{
mutt_error _("Unable to attach!");
- safe_free ((void **) &idx[idxlen]);
+ FREE (&idx[idxlen]);
}
}
}
@@ -914,7 +914,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
mx_close_mailbox (Context, NULL);
else
mx_fastclose_mailbox (Context);
- safe_free ((void **) &Context);
+ FREE (&Context);
/* go back to the folder we started from */
Context = this;
@@ -1166,7 +1166,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
if (!(fp = safe_fopen (fname, "w")))
{
mutt_error (_("Can't create file %s"), fname);
- safe_free ((void **) &idx[idxlen]);
+ FREE (&idx[idxlen]);
continue;
}
fclose (fp);
@@ -1243,10 +1243,10 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
idx[idxlen]->content->next = NULL;
idx[idxlen]->content->parts = NULL;
mutt_free_body (&idx[idxlen]->content);
- safe_free ((void **) &idx[idxlen]->tree);
- safe_free ((void **) &idx[idxlen]);
+ FREE (&idx[idxlen]->tree);
+ FREE (&idx[idxlen]);
}
- safe_free ((void **) &idx);
+ FREE (&idx);
idxlen = 0;
idxmax = 0;
r = -1;
@@ -1389,12 +1389,12 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
{
msg->content = idx[0]->content;
for (i = 0; i < idxlen; i++)
- safe_free ((void **) &idx[i]);
+ FREE (&idx[i]);
}
else
msg->content = NULL;
- safe_free ((void **) &idx);
+ FREE (&idx);
return (r);
}
diff --git a/copy.c b/copy.c
index 62a4f354..b99ad942 100644
--- a/copy.c
+++ b/copy.c
@@ -261,8 +261,8 @@ mutt_copy_hdr (FILE *in, FILE *out, long off_start, long off_end, int flags,
/* Free in a separate loop to be sure that all headers are freed
* in case of error. */
for (x = 0; x < hdr_count; x++)
- safe_free ((void **) &headers[x]);
- safe_free ((void **) &headers);
+ FREE (&headers[x]);
+ FREE (&headers);
if (error)
return (-1);
diff --git a/crypt.c b/crypt.c
index 95b1fee9..d08ee7a0 100644
--- a/crypt.c
+++ b/crypt.c
@@ -770,7 +770,7 @@ void mutt_signed_handler (BODY *a, STATE *s)
state_attach_puts (_("[-- The following data is signed --]\n\n"), s);
- safe_free((void **) &signatures);
+ FREE (&signatures);
}
else
state_attach_puts (_("[-- Warning: Can't find any signatures. --]\n\n"), s);
diff --git a/curs_main.c b/curs_main.c
index 599b5b0a..08b9f30e 100644
--- a/curs_main.c
+++ b/curs_main.c
@@ -481,7 +481,7 @@ int mutt_index_menu (void)
if (!Context->path)
{
/* fatal error occurred */
- safe_free ((void **) &Context);
+ FREE (&Context);
menu->redraw = REDRAW_FULL;
}
@@ -978,7 +978,7 @@ int mutt_index_menu (void)
/* check for a fatal error, or all messages deleted */
if (!Context->path)
- safe_free ((void **) &Context);
+ FREE (&Context);
/* if we were in the pager, redisplay the message */
if (menu->menu == MENU_PAGER)
@@ -1038,7 +1038,7 @@ int mutt_index_menu (void)
menu->redraw = REDRAW_INDEX | REDRAW_STATUS;
break;
}
- safe_free ((void **) &Context);
+ FREE (&Context);
}
mutt_sleep (0);
@@ -1109,7 +1109,7 @@ int mutt_index_menu (void)
if (Context)
{
mx_fastclose_mailbox (Context);
- safe_free ((void **) &Context);
+ FREE (&Context);
}
done = 1;
}
diff --git a/enter.c b/enter.c
index 4cef35f6..a5bf5a9d 100644
--- a/enter.c
+++ b/enter.c
@@ -165,7 +165,7 @@ static void replace_part (ENTER_STATE *state, size_t from, char *buf)
memcpy (state->wbuf + state->curpos, savebuf, savelen * sizeof (wchar_t));
state->lastchar = state->curpos + savelen;
- safe_free ((void **) &savebuf);
+ FREE (&savebuf);
}
/*
@@ -686,7 +686,7 @@ self_insert:
bye:
- safe_free ((void **) &tempbuf);
+ FREE (&tempbuf);
return rv;
}
@@ -694,8 +694,8 @@ void mutt_free_enter_state (ENTER_STATE **esp)
{
if (!esp) return;
- safe_free ((void **) &(*esp)->wbuf);
- safe_free ((void **) esp);
+ FREE (&(*esp)->wbuf);
+ FREE (esp);
}
/*
diff --git a/gnupgparse.c b/gnupgparse.c
index 01a0a6b5..ad8259c3 100644
--- a/gnupgparse.c
+++ b/gnupgparse.c
@@ -107,7 +107,7 @@ static void fix_uid (char *uid)
else if (ob-buf == n && (buf[n] = 0, strlen (buf) < n))
memcpy (uid, buf, n);
}
- safe_free ((void **) &buf);
+ FREE (&buf);
iconv_close (cd);
}
}
diff --git a/hash.c b/hash.c
index a9b7b5d9..c9037ca1 100644
--- a/hash.c
+++ b/hash.c
@@ -146,9 +146,9 @@ void hash_destroy (HASH **ptr, void (*destroy) (void *))
elem = elem->next;
if (destroy)
destroy (tmp->data);
- safe_free ((void **) &tmp);
+ FREE (&tmp);
}
}
- safe_free ((void **) &pptr->table);
- safe_free ((void **) ptr);
+ FREE (&pptr->table);
+ FREE (ptr);
}
diff --git a/history.c b/history.c
index 5130a7f0..1e9743fb 100644
--- a/history.c
+++ b/history.c
@@ -40,8 +40,8 @@ static void init_history (struct history *h)
if (h->hist)
{
for (i = 0 ; i < OldSize ; i ++)
- safe_free ((void **) &h->hist[i]);
- safe_free ((void **) &h->hist);
+ FREE (&h->hist[i]);
+ FREE (&h->hist);
}
}
diff --git a/hook.c b/hook.c
index dbb62d8f..c1091219 100644
--- a/hook.c
+++ b/hook.c
@@ -165,7 +165,7 @@ int mutt_parse_hook (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err)
{
regerror (rc, rx, err->data, err->dsize);
regfree (rx);
- safe_free ((void **) &rx);
+ FREE (&rx);
goto error;
}
}
diff --git a/imap/command.c b/imap/command.c
index bd01aa0e..d1d3ef39 100644
--- a/imap/command.c
+++ b/imap/command.c
@@ -192,7 +192,7 @@ int imap_exec (IMAP_DATA* idata, const char* cmd, int flags)
rc = mutt_socket_write_d (idata->conn, out,
flags & IMAP_CMD_PASS ? IMAP_LOG_PASS : IMAP_LOG_CMD);
- safe_free ((void**) &out);
+ FREE (&out);
if (rc < 0)
{
diff --git a/imap/imap.c b/imap/imap.c
index cfb2e354..cf7258ec 100644
--- a/imap/imap.c
+++ b/imap/imap.c
@@ -869,7 +869,7 @@ int imap_make_msg_set (IMAP_DATA* idata, BUFFER* buf, int flag, int changed)
}
}
- safe_free ((void**) &hdrs);
+ FREE (&hdrs);
return count;
}
@@ -1089,7 +1089,7 @@ void imap_close_mailbox (CONTEXT* ctx)
if (idata->cache[i].path)
{
unlink (idata->cache[i].path);
- safe_free ((void **) &idata->cache[i].path);
+ FREE (&idata->cache[i].path);
}
}
}
diff --git a/imap/message.c b/imap/message.c
index 289fc0d4..47136fda 100644
--- a/imap/message.c
+++ b/imap/message.c
@@ -254,7 +254,7 @@ int imap_fetch_message (MESSAGE *msg, CONTEXT *ctx, int msgno)
cache->path = safe_strdup (path);
if (!(msg->fp = safe_fopen (path, "w+")))
{
- safe_free ((void**) &cache->path);
+ FREE (&cache->path);
return -1;
}
@@ -676,7 +676,7 @@ void imap_free_header_data (void** data)
/* this should be safe even if the list wasn't used */
mutt_free_list (&(((IMAP_HEADER_DATA*) *data)->keywords));
- safe_free (data);
+ FREE (data);
}
/* imap_set_flags: fill out the message header according to the flags from
diff --git a/imap/utf7.c b/imap/utf7.c
index fc68203b..14211a07 100644
--- a/imap/utf7.c
+++ b/imap/utf7.c
@@ -130,7 +130,7 @@ static char *utf7_to_utf8 (const char *u7, size_t u7len, char **u8,
return buf;
bail:
- safe_free ((void **) &buf);
+ FREE (&buf);
return 0;
}
@@ -220,7 +220,7 @@ static char *utf8_to_utf7 (const char *u8, size_t u8len, char **u7,
if (u8len)
{
- safe_free ((void **) &buf);
+ FREE (&buf);
return 0;
}
@@ -239,7 +239,7 @@ static char *utf8_to_utf7 (const char *u8, size_t u8len, char **u7,
return buf;
bail:
- safe_free ((void **) &buf);
+ FREE (&buf);
return 0;
}
@@ -250,7 +250,7 @@ void imap_utf7_encode (char **s)
char *t = safe_strdup (*s);
if (!mutt_convert_string (&t, Charset, "UTF-8", 0))
utf8_to_utf7 (t, strlen (t), s, 0);
- safe_free ((void **) &t);
+ FREE (&t);
}
}
@@ -261,7 +261,7 @@ void imap_utf7_decode (char **s)
char *t = utf7_to_utf8 (*s, strlen (*s), 0, 0);
if (t && !mutt_convert_string (&t, "UTF-8", Charset, 0))
{
- safe_free ((void **) s);
+ FREE (s);
*s = t;
}
}
diff --git a/imap/util.c b/imap/util.c
index 2aa1471e..10d93cd9 100644
--- a/imap/util.c
+++ b/imap/util.c
@@ -508,7 +508,7 @@ void imap_munge_mbox_name (char *dest, size_t dlen, const char *src)
imap_quote_string (dest, dlen, buf);
- safe_free ((void **) &buf);
+ FREE (&buf);
}
void imap_unmunge_mbox_name (char *s)
@@ -524,7 +524,7 @@ void imap_unmunge_mbox_name (char *s)
strncpy (s, buf, strlen (s));
}
- safe_free ((void **) &buf);
+ FREE (&buf);
}
/* imap_wordcasecmp: find word a in word list b */
diff --git a/init.c b/init.c
index 93c30c88..41710270 100644
--- a/init.c
+++ b/init.c
@@ -342,12 +342,12 @@ static void remove_from_list (LIST **l, const char *str)
{
if (ascii_strcasecmp (str, p->data) == 0)
{
- safe_free ((void **) &p->data);
+ FREE (&p->data);
if (last)
last->next = p->next;
else
(*l) = p->next;
- safe_free ((void **) &p);
+ FREE (&p);
}
else
{
@@ -611,7 +611,7 @@ static int parse_my_hdr (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err
if (ascii_strncasecmp (buf->data, tmp->data, keylen) == 0)
{
/* replace the old value */
- safe_free ((void **) &tmp->data);
+ FREE (&tmp->data);
tmp->data = buf->data;
memset (buf, 0, sizeof (BUFFER));
return 0;
@@ -902,7 +902,7 @@ static int parse_set (BUFFER *tmp, BUFFER *s, unsigned long data, BUFFER *err)
if (DTYPE (MuttVars[idx].type) == DT_ADDR)
rfc822_free_address ((ADDRESS **) MuttVars[idx].data);
else
- safe_free ((void **) MuttVars[idx].data);
+ FREE (MuttVars[idx].data);
}
else if (query || *s->dptr != '=')
{
@@ -1273,7 +1273,7 @@ static int source_rc (const char *rcfile, BUFFER *err)
rc = -1;
}
FREE (&token.data);
- safe_free ((void **) &linebuf);
+ FREE (&linebuf);
fclose (f);
if (pid != -1)
mutt_wait_filter (pid);
diff --git a/lib.c b/lib.c
index a9dad9de..9e72d2cc 100644
--- a/lib.c
+++ b/lib.c
@@ -145,7 +145,7 @@ char *safe_strdup (const char *s)
void mutt_str_replace (char **p, const char *s)
{
- safe_free ((void **) p);
+ FREE (p);
*p = safe_strdup (s);
}
@@ -451,7 +451,7 @@ char *mutt_read_line (char *s, size_t *size, FILE *fp, int *line)
{
if (fgets (s + offset, *size - offset, fp) == NULL)
{
- safe_free ((void **) &s);
+ FREE (&s);
return NULL;
}
if ((ch = strchr (s + offset, '\n')) != NULL)
diff --git a/main.c b/main.c
index 40d1c15c..93751302 100644
--- a/main.c
+++ b/main.c
@@ -797,7 +797,7 @@ int main (int argc, char **argv)
}
}
- safe_free ((void **) &bodytext);
+ FREE (&bodytext);
if (attach)
{
@@ -885,7 +885,7 @@ int main (int argc, char **argv)
{
mutt_index_menu ();
if (Context)
- safe_free ((void **)&Context);
+ FREE (&Context);
}
mutt_endwin (Errorbuf);
}
diff --git a/mbox.c b/mbox.c
index fa0f2218..c9635092 100644
--- a/mbox.c
+++ b/mbox.c