aboutsummaryrefslogtreecommitdiffstats
path: root/src/listbox.c
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@calcurse.org>2016-10-13 08:20:35 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2016-10-13 19:51:43 +0200
commit9ef5fe2191c5d1d857bc4fe828c15268ba8caa90 (patch)
treea02c31a337f0b189ea0cab7141901ee455ccc3d9 /src/listbox.c
parentda6334cf385ff064a8296e8c0d0e080fa2014eaa (diff)
downloadcalcurse-9ef5fe2191c5d1d857bc4fe828c15268ba8caa90.tar.gz
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/listbox.c')
-rw-r--r--src/listbox.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/listbox.c b/src/listbox.c
index 333ddeb..a620adb 100644
--- a/src/listbox.c
+++ b/src/listbox.c
@@ -56,8 +56,8 @@ void listbox_delete(struct listbox *lb)
{
EXIT_IF(lb == NULL, "null pointer");
wins_scrollwin_delete(&(lb->sw));
- free(lb->type);
- free(lb->ch);
+ mem_free(lb->type);
+ mem_free(lb->ch);
}
void listbox_resize(struct listbox *lb, int y, int x, int h, int w)
@@ -95,8 +95,8 @@ void listbox_load_items(struct listbox *lb, int item_count)
return;
}
- free(lb->type);
- free(lb->ch);
+ mem_free(lb->type);
+ mem_free(lb->ch);
lb->type = mem_malloc(item_count * sizeof(unsigned));
lb->ch = mem_malloc((item_count + 1) * sizeof(unsigned));
for (i = 0, ch = 0; i < item_count; i++) {