blob: ab47b65a8499aa6f34fa84a79a3b0ea21c5bac04 [file] [log] [blame]
Michal Vasko1324b6c2018-09-07 11:16:23 +02001/**
2 * @file common.c
3 * @author Michal Vasko <mvasko@cesnet.cz>
4 * @brief common internal definitions for libyang
5 *
6 * Copyright (c) 2018 CESNET, z.s.p.o.
7 *
8 * This source code is licensed under BSD 3-Clause License (the "License").
9 * You may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * https://opensource.org/licenses/BSD-3-Clause
13 */
14
15#include <stdlib.h>
16
17void *
18ly_realloc(void *ptr, size_t size)
19{
20 void *new_mem;
21
22 new_mem = realloc(ptr, size);
23 if (!new_mem) {
24 free(ptr);
25 }
26
27 return new_mem;
28}