aboutsummaryrefslogtreecommitdiffstats
path: root/c_src/sdl_keyboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'c_src/sdl_keyboard.c')
-rw-r--r--c_src/sdl_keyboard.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/c_src/sdl_keyboard.c b/c_src/sdl_keyboard.c
index d4b4233..c46cc75 100644
--- a/c_src/sdl_keyboard.c
+++ b/c_src/sdl_keyboard.c
@@ -282,9 +282,8 @@ NIF_CAST_HANDLER(thread_set_text_input_rect)
NIF_FUNCTION(set_text_input_rect)
{
- SDL_Rect* rect = NULL;
+ SDL_Rect* rect = (SDL_Rect*)enif_alloc(sizeof(SDL_Rect));
- rect = (SDL_Rect*)enif_alloc(sizeof(SDL_Rect));
if (!map_to_rect(env, argv[0], rect)) {
enif_free(rect);
return enif_make_badarg(env);