diff options
author | Lukas Fleischer <lfleischer@calcurse.org> | 2016-10-13 08:20:35 +0200 |
---|---|---|
committer | Lukas Fleischer <lfleischer@calcurse.org> | 2016-10-13 19:51:43 +0200 |
commit | 9ef5fe2191c5d1d857bc4fe828c15268ba8caa90 (patch) | |
tree | a02c31a337f0b189ea0cab7141901ee455ccc3d9 /src/vector.c | |
parent | da6334cf385ff064a8296e8c0d0e080fa2014eaa (diff) | |
download | calcurse-9ef5fe2191c5d1d857bc4fe828c15268ba8caa90.zip |
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>
Diffstat (limited to 'src/vector.c')
-rw-r--r-- | src/vector.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vector.c b/src/vector.c index 10294a7..ef59f8f 100644 --- a/src/vector.c +++ b/src/vector.c @@ -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; |