Always use memory management wrappers

Use mem_*() wrappers instead of directly accessing libc functions when
allocating/deallocating memory.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
Lukas Fleischer
2016-10-13 08:20:35 +02:00
parent da6334cf38
commit 9ef5fe2191
7 changed files with 18 additions and 18 deletions

View File

@@ -53,7 +53,7 @@ void vector_free(vector_t *v)
{
v->count = 0;
v->size = 0;
free(v->data);
mem_free(v->data);
v->data = NULL;
}
@@ -100,7 +100,7 @@ void vector_add(vector_t *v, void *data)
{
if (v->count >= v->size) {
v->size *= 2;
v->data = realloc(v->data, v->size * sizeof(void *));
v->data = mem_realloc(v->data, v->size, sizeof(void *));
}
v->data[v->count] = data;