blob: d3fb2134a8903a975dd9a1f0248998590c455e70 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
/***
* libccd
* ---------------------------------
* Copyright (c)2010 Daniel Fiser <danfis@danfis.cz>
*
*
* This file is part of libccd.
*
* Distributed under the OSI-approved BSD License (the "License");
* see accompanying file BDS-LICENSE for details or see
* <http://www.opensource.org/licenses/bsd-license.php>.
*
* This software is distributed WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the License for more information.
*/
#include <stdio.h>
#include <ccd/alloc.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
void *ccdRealloc(void *ptr, size_t size)
{
void *ret = realloc(ptr, size);
if (ret == NULL && size != 0){
fprintf(stderr, "Fatal error: Allocation of memory failed!\n");
fflush(stderr);
exit(-1);
}
return ret;
}
|