aboutsummaryrefslogtreecommitdiffstats
path: root/calloc.c
blob: 86a939c7364fc36825141d13c471feb253f4843d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* See LICENSE file for copyright and license details. */
#include "internal.h"


void
liberror_calloc_failed(size_t n, size_t m)
{
	liberror_set_error_errno("Out of memory", "calloc", ENOMEM);
	errno = ENOMEM;
	(void) n;
	(void) m;
}


void *
liberror_calloc(size_t n, size_t m)
{
	void *ret = calloc(n, m);
	if (ret || !n || !m)
		return ret;
	liberror_save_backtrace(NULL);
	liberror_calloc_failed(n, m);
	return NULL;
}