diff --git a/runahead/mem_util.c b/runahead/mem_util.c index 6d807236e7..a350f14c6a 100644 --- a/runahead/mem_util.c +++ b/runahead/mem_util.c @@ -9,11 +9,6 @@ void *malloc_zero(size_t size) return ptr; } -void free_str(char **str_p) -{ - free_ptr((void**)str_p); -} - void free_ptr(void **data_p) { if (!data_p || !*data_p) diff --git a/runahead/mem_util.h b/runahead/mem_util.h index d91047244f..fedcf1ca70 100644 --- a/runahead/mem_util.h +++ b/runahead/mem_util.h @@ -12,7 +12,6 @@ RETRO_BEGIN_DECLS void *malloc_zero(size_t size); -void free_str(char **str_p); void free_ptr(void **data_p); char *strcpy_alloc(const char *sourceStr); char *strcpy_alloc_force(const char *sourceStr); diff --git a/runahead/secondary_core.c b/runahead/secondary_core.c index 8912b4ea7c..3d66c4ed77 100644 --- a/runahead/secondary_core.c +++ b/runahead/secondary_core.c @@ -128,16 +128,16 @@ char* copy_core_to_temp_file(void) goto failed; } - free_str(&tempDirectory); - free_str(&retroarchTempPath); + free_ptr((void**)&tempDirectory); + free_ptr((void**)&retroarchTempPath); free_ptr(&dllFileData); return tempDllPath; failed: - free_str(&tempDirectory); - free_str(&retroarchTempPath); - free_str(&tempDllPath); - free_ptr(&dllFileData); + free_ptr((void**)&tempDirectory); + free_ptr((void**)&retroarchTempPath); + free_ptr((void**)&tempDllPath); + free_ptr((void**)&dllFileData); return NULL; } @@ -168,7 +168,7 @@ bool write_file_with_random_name(char **tempDllPath, numberValue = numberValue * 214013 + 2531011; number = (numberValue >> 14) % 100000; sprintf(numberBuf, "%05d", number); - free_str(tempDllPath); + free_ptr((void**)tempDllPath); strcat_alloc(tempDllPath, retroarchTempPath); strcat_alloc(tempDllPath, prefix); strcat_alloc(tempDllPath, numberBuf); @@ -178,7 +178,7 @@ bool write_file_with_random_name(char **tempDllPath, break; } - free_str(&ext); + free_ptr((void**)&ext); return true; } @@ -199,7 +199,7 @@ bool secondary_core_create(void) load_content_info->special) return false; - free_str(&secondary_library_path); + free_ptr((void**)&secondary_library_path); secondary_library_path = copy_core_to_temp_file(); if (!secondary_library_path) @@ -321,7 +321,7 @@ void secondary_core_destroy(void) dylib_close(secondary_module); secondary_module = NULL; filestream_delete(secondary_library_path); - free_str(&secondary_library_path); + free_ptr((void**)&secondary_library_path); } }