X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=pop%2Fpop.c;h=1b70009268bc795b8945d1f5a66cc45172ddab64;hb=23002a877577341cfd68687e58348e0ca01b1ac5;hp=34d1cc779e126ca2eec31738df223b81952256f3;hpb=c8ceef3ed6424dcb5a6ec835e7d8d9cc00595372;p=apps%2Fmadmutt.git diff --git a/pop/pop.c b/pop/pop.c index 34d1cc7..1b70009 100644 --- a/pop/pop.c +++ b/pop/pop.c @@ -11,6 +11,8 @@ # include "config.h" #endif +#include + #include "mutt.h" #include "mx.h" #include "pop.h" @@ -246,10 +248,10 @@ int pop_open_mailbox (CONTEXT * ctx) if (!conn) return -1; - mem_free (&ctx->path); + p_delete(&ctx->path); ctx->path = str_dup (buf); - pop_data = mem_calloc (1, sizeof (POP_DATA)); + pop_data = p_new(POP_DATA, 1); pop_data->conn = conn; ctx->data = pop_data; @@ -291,7 +293,7 @@ static void pop_clear_cache (POP_DATA * pop_data) for (i = 0; i < POP_CACHE_LEN; i++) { if (pop_data->cache[i].path) { unlink (pop_data->cache[i].path); - mem_free (&pop_data->cache[i].path); + p_delete(&pop_data->cache[i].path); } } } @@ -349,7 +351,7 @@ int pop_fetch_message (MESSAGE * msg, CONTEXT * ctx, int msgno) else { /* clear the previous entry */ unlink (cache->path); - mem_free (&cache->path); + p_delete(&cache->path); } } @@ -524,7 +526,7 @@ void pop_fetch_mail (void) return; } - url = p = mem_calloc (strlen (PopHost) + 7, sizeof (char)); + url = p = p_new(char, strlen (PopHost) + 7); if (url_check_scheme (PopHost) == U_UNKNOWN) { strcpy (url, "pop://"); /* __STRCPY_CHECKED__ */ p = strchr (url, '\0'); @@ -532,7 +534,7 @@ void pop_fetch_mail (void) strcpy (p, PopHost); /* __STRCPY_CHECKED__ */ ret = pop_parse_path (url, &acct); - mem_free (&url); + p_delete(&url); if (ret) { mutt_error (_("%s is an invalid POP path"), PopHost); return; @@ -542,12 +544,12 @@ void pop_fetch_mail (void) if (!conn) return; - pop_data = mem_calloc (1, sizeof (POP_DATA)); + pop_data = p_new(POP_DATA, 1); pop_data->conn = conn; if (pop_open_connection (pop_data) < 0) { mutt_socket_free (pop_data->conn); - mem_free (&pop_data); + p_delete(&pop_data); return; } @@ -649,11 +651,11 @@ finish: if (pop_query (pop_data, buffer, sizeof (buffer)) == PQ_NOT_CONNECTED) goto fail; mutt_socket_close (conn); - mem_free (&pop_data); + p_delete(&pop_data); return; fail: mutt_error _("Server closed connection!"); mutt_socket_close (conn); - mem_free (&pop_data); + p_delete(&pop_data); }