# include "config.h"
#endif
+#include <lib-lib/mem.h>
+
#include "mutt.h"
#include "mx.h"
#include "pop.h"
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;
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);
}
}
}
else {
/* clear the previous entry */
unlink (cache->path);
- mem_free (&cache->path);
+ p_delete(&cache->path);
}
}
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');
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;
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;
}
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);
}