diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 2002-12-10 20:56:47 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 2002-12-10 20:56:47 +0000 |
commit | b62866d93e48a510912a1f503d907a2320da9238 (patch) | |
tree | 807a4c446cbec93779394a22cbc645430c8c94b1 | |
parent | cd96c3449e02199afe9cde511f128bb387f5f4d3 (diff) |
Replace safe_free calls by the FREE macro.
-rw-r--r-- | addrbook.c | 2 | ||||
-rw-r--r-- | alias.c | 2 | ||||
-rw-r--r-- | attach.c | 8 | ||||
-rw-r--r-- | browser.c | 18 | ||||
-rw-r--r-- | buffy.c | 8 | ||||
-rw-r--r-- | charset.c | 4 | ||||
-rw-r--r-- | color.c | 8 | ||||
-rw-r--r-- | compose.c | 28 | ||||
-rw-r--r-- | copy.c | 4 | ||||
-rw-r--r-- | crypt.c | 2 | ||||
-rw-r--r-- | curs_main.c | 8 | ||||
-rw-r--r-- | enter.c | 8 | ||||
-rw-r--r-- | gnupgparse.c | 2 | ||||
-rw-r--r-- | hash.c | 6 | ||||
-rw-r--r-- | history.c | 4 | ||||
-rw-r--r-- | hook.c | 2 | ||||
-rw-r--r-- | imap/command.c | 2 | ||||
-rw-r--r-- | imap/imap.c | 4 | ||||
-rw-r--r-- | imap/message.c | 4 | ||||
-rw-r--r-- | imap/utf7.c | 10 | ||||
-rw-r--r-- | imap/util.c | 4 | ||||
-rw-r--r-- | init.c | 10 | ||||
-rw-r--r-- | lib.c | 4 | ||||
-rw-r--r-- | main.c | 4 | ||||
-rw-r--r-- | mbox.c | 16 | ||||
-rw-r--r-- | menu.c | 8 | ||||
-rw-r--r-- | mh.c | 18 | ||||
-rw-r--r-- | mutt_ssl.c | 2 | ||||
-rw-r--r-- | mutt_ssl_nss.c | 4 | ||||
-rw-r--r-- | muttlib.c | 50 | ||||
-rw-r--r-- | mx.c | 12 | ||||
-rw-r--r-- | pager.c | 20 | ||||
-rw-r--r-- | parse.c | 6 | ||||
-rw-r--r-- | pattern.c | 8 | ||||
-rw-r--r-- | pgp.c | 6 | ||||
-rw-r--r-- | pgpkey.c | 4 | ||||
-rw-r--r-- | pgplib.c | 10 | ||||
-rw-r--r-- | pgppacket.c | 2 | ||||
-rw-r--r-- | pgppubring.c | 6 | ||||
-rw-r--r-- | pop.c | 2 | ||||
-rw-r--r-- | pop_auth.c | 2 | ||||
-rw-r--r-- | postpone.c | 12 | ||||
-rw-r--r-- | query.c | 18 | ||||
-rw-r--r-- | recvattach.c | 6 | ||||
-rw-r--r-- | remailer.c | 14 | ||||
-rw-r--r-- | rfc1524.c | 32 | ||||
-rw-r--r-- | rfc2047.c | 28 | ||||
-rw-r--r-- | rfc2231.c | 16 | ||||
-rw-r--r-- | rfc822.c | 2 | ||||
-rw-r--r-- | score.c | 4 | ||||
-rw-r--r-- | send.c | 2 | ||||
-rw-r--r-- | sendlib.c | 36 | ||||
-rw-r--r-- | smime.c | 22 | ||||
-rw-r--r-- | thread.c | 10 | ||||
-rw-r--r-- | url.c | 2 |
55 files changed, 268 insertions, 268 deletions
@@ -231,6 +231,6 @@ new_aliases: rfc822_write_address (buf, buflen, AliasTable[t]->addr); mutt_menuDestroy (&menu); - safe_free ((void **) &AliasTable); + FREE (&AliasTable); } @@ -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 */ @@ -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); } } } @@ -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; @@ -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; @@ -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); } @@ -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; @@ -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); } @@ -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); @@ -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; } @@ -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); } } @@ -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); } @@ -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); } } @@ -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 */ @@ -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); @@ -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) @@ -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); } |