{
int rc;
- struct HcacheLmdbCtx *ctx = safe_malloc(sizeof(struct HcacheLmdbCtx));
- ctx->txn = NULL;
- ctx->db = 0;
+ struct HcacheLmdbCtx *ctx = safe_calloc(1, sizeof(struct HcacheLmdbCtx));
rc = mdb_env_create(&ctx->env);
if (rc != MDB_SUCCESS)
*/
#include "config.h"
+#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include "memory.h"
if (!nmemb || !size)
return NULL;
- if (((size_t) -1) / nmemb <= size)
+ if (nmemb > (SIZE_MAX / size))
{
mutt_error(_("Integer overflow -- can't allocate memory!"));
sleep(1);