Always use SDL_malloc() and SDL_free()

To avoid mixing SDL_malloc()/SDL_strdup() with free(), or malloc() with
SDL_free(), always use the SDL version.
This commit is contained in:
Romain Vimont
2019-05-30 00:10:45 +02:00
parent 7ed976967f
commit 3bc1c51b91
4 changed files with 12 additions and 10 deletions

View File

@@ -44,7 +44,7 @@ cmd_execute(const char *path, const char *const argv[], HANDLE *handle) {
#endif
if (!CreateProcessW(NULL, wide, NULL, NULL, FALSE, flags, NULL, NULL, &si,
&pi)) {
free(wide);
SDL_free(wide);
*handle = NULL;
if (GetLastError() == ERROR_FILE_NOT_FOUND) {
return PROCESS_ERROR_MISSING_BINARY;
@@ -52,7 +52,7 @@ cmd_execute(const char *path, const char *const argv[], HANDLE *handle) {
return PROCESS_ERROR_GENERIC;
}
free(wide);
SDL_free(wide);
*handle = pi.hProcess;
return PROCESS_SUCCESS;
}