From 91ec77f04ac84ac9941336fe0f6eaf4bd42786cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 31 Jan 2018 17:48:56 +0100 Subject: Replace malloc/free with enif_alloc/enif_free --- c_src/esdl2_cursors.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'c_src/esdl2_cursors.c') diff --git a/c_src/esdl2_cursors.c b/c_src/esdl2_cursors.c index 569a787..b056c08 100644 --- a/c_src/esdl2_cursors.c +++ b/c_src/esdl2_cursors.c @@ -33,7 +33,7 @@ void esdl2_cursors_insert(SDL_Cursor* cursor, obj_Cursor* res) { struct esdl2_cursor* item; - item = malloc(sizeof(struct esdl2_cursor)); + item = enif_alloc(sizeof(struct esdl2_cursor)); item->cursor = cursor; item->res = res; @@ -89,7 +89,7 @@ void esdl2_cursors_free() head = LIST_FIRST(&cursors); while (head != NULL) { next = LIST_NEXT(head, entries); - free(head); + enif_free(head); head = next; } } -- cgit v1.2.3