diff options
author | Loïc Hoguin <[email protected]> | 2018-01-31 17:48:56 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2018-01-31 17:48:56 +0100 |
commit | 91ec77f04ac84ac9941336fe0f6eaf4bd42786cf (patch) | |
tree | dc169d23aee766a1ab522f07e7bb0c575c21d0af /c_src/sdl_clipboard.c | |
parent | 6cb12f50fcbe091de56461100b5d527294405dd9 (diff) | |
download | esdl2-91ec77f04ac84ac9941336fe0f6eaf4bd42786cf.tar.gz esdl2-91ec77f04ac84ac9941336fe0f6eaf4bd42786cf.tar.bz2 esdl2-91ec77f04ac84ac9941336fe0f6eaf4bd42786cf.zip |
Replace malloc/free with enif_alloc/enif_free
Diffstat (limited to 'c_src/sdl_clipboard.c')
-rw-r--r-- | c_src/sdl_clipboard.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/c_src/sdl_clipboard.c b/c_src/sdl_clipboard.c index 2d776a9..33731a7 100644 --- a/c_src/sdl_clipboard.c +++ b/c_src/sdl_clipboard.c @@ -57,13 +57,13 @@ NIF_FUNCTION(set_clipboard_text) BADARG_IF(!enif_inspect_binary(env, argv[0], &bin)); - text = malloc(bin.size + 1); + text = enif_alloc(bin.size + 1); memcpy(text, bin.data, bin.size); text[bin.size] = '\0'; ret = SDL_SetClipboardText(text); - free(text); + enif_free(text); if (ret != 0) return sdl_error_tuple(env); |