COMPRESS_INFO *ci;
/* Now lets uncompress this thing */
- ci = safe_malloc (sizeof (COMPRESS_INFO));
+ ci = mem_malloc (sizeof (COMPRESS_INFO));
ctx->compressinfo = (void *) ci;
ci->append = find_compress_hook (M_APPENDHOOK, ctx->path);
ci->open = find_compress_hook (M_OPENHOOK, ctx->path);
/* Uncompress to /tmp */
mutt_mktemp (tmppath);
- ctx->path = safe_malloc (safe_strlen (tmppath) + 1);
+ ctx->path = mem_malloc (str_len (tmppath) + 1);
strcpy (ctx->path, tmppath);
}
mutt_FormatString (expanded, sizeof (expanded), cmd,
compresshook_format_str, (unsigned long) ctx, 0);
- return safe_strdup (expanded);
+ return str_dup (expanded);
}
int mutt_check_mailbox_compressed (CONTEXT * ctx)
COMPRESS_INFO *ci = (COMPRESS_INFO *) ctx->compressinfo;
if (ci->size != get_size (ctx->realpath)) {
- FREE (&ctx->compressinfo);
- FREE (&ctx->realpath);
+ mem_free (&ctx->compressinfo);
+ mem_free (&ctx->realpath);
mutt_error _("Mailbox was corrupted!");
return (-1);
if (!ci->open) {
ctx->magic = 0;
- FREE (ctx->compressinfo);
+ mem_free (ctx->compressinfo);
return (-1);
}
if (!ci->close || access (ctx->path, W_OK) != 0)
if ((fp = fopen (ctx->realpath, "r")) == NULL) {
mutt_perror (ctx->realpath);
- FREE (&cmd);
+ mem_free (&cmd);
return (-1);
}
mutt_block_signals ();
mutt_unblock_signals ();
mutt_error _("Unable to lock mailbox!");
- FREE (&cmd);
+ mem_free (&cmd);
return (-1);
}
if (rc) {
mutt_any_key_to_continue (NULL);
ctx->magic = 0;
- FREE (ctx->compressinfo);
+ mem_free (ctx->compressinfo);
mutt_error (_("Error executing: %s : unable to open the mailbox!\n"),
cmd);
}
- FREE (&cmd);
+ mem_free (&cmd);
if (rc)
return (-1);
void restore_path (CONTEXT * ctx)
{
- FREE (&ctx->path);
+ mem_free (&ctx->path);
ctx->path = ctx->realpath;
}
return (mutt_open_read_compressed (ctx));
ctx->magic = 0;
- FREE (&ctx->compressinfo);
+ mem_free (&ctx->compressinfo);
return (-1);
}
remove_file (ctx);
restore_path (ctx);
- FREE (&ctx->compressinfo);
+ mem_free (&ctx->compressinfo);
}
}
if ((fp = fopen (ctx->realpath, "a")) == NULL) {
mutt_perror (ctx->realpath);
- FREE (&cmd);
+ mem_free (&cmd);
return (-1);
}
mutt_block_signals ();
store_size (ctx);
- FREE (&cmd);
+ mem_free (&cmd);
return (-1);
}
mutt_unblock_signals ();
fclose (fp);
- FREE (&cmd);
+ mem_free (&cmd);
store_size (ctx);
if ((fp = fopen (ctx->realpath, "a")) == NULL) {
mutt_perror (ctx->realpath);
- FREE (&cmd);
+ mem_free (&cmd);
return (-1);
}
mutt_block_signals ();
mutt_unblock_signals ();
mutt_error _("Unable to lock mailbox!");
- FREE (&cmd);
+ mem_free (&cmd);
return (-1);
}
mutt_error (_
(" %s: Error compressing mailbox! Uncompressed one kept!\n"),
ctx->path);
- FREE (&cmd);
+ mem_free (&cmd);
mbox_unlock_compressed (ctx, fp);
mutt_unblock_signals ();
fclose (fp);
fclose (fp);
remove_file (ctx);
restore_path (ctx);
- FREE (&cmd);
- FREE (&ctx->compressinfo);
+ mem_free (&cmd);
+ mem_free (&ctx->compressinfo);
return (0);
}
mx_t* compress_reg_mx (void) {
- mx_t* fmt = safe_calloc (1, sizeof (mx_t));
+ mx_t* fmt = mem_calloc (1, sizeof (mx_t));
fmt->type = M_COMPRESSED;
fmt->local = 1;
fmt->mx_is_magic = mbox_is_magic;