aboutsummaryrefslogtreecommitdiffstats
path: root/realloc.c
blob: a0292213a263cc77a49ea807cbaa876b541742cd (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_realloc_failed(void *ptr, size_t n)
{
	liberror_set_error_errno("Out of memory", "realloc", ENOMEM);
	errno = ENOMEM;
	(void) ptr;
	(void) n;
}


void *
liberror_realloc(void *ptr, size_t n)
{
	void *ret = realloc(ptr, n);
	if (ret || !n)
		return ret;
	liberror_save_backtrace(NULL);
	liberror_realloc_failed(ptr, n);
	return NULL;
}