Unverified Commit d9c6b753 authored by Tony's avatar Tony Committed by GitHub
Browse files

Merge pull request #370 from jdgleaver/leak-fix

Fix memory leak when initialising virtual drive buffers
parents 0c8aef54 58afd750
Pipeline #50832 passed with stages
in 22 minutes and 22 seconds
......@@ -131,6 +131,14 @@ int vdrive_device_setup(vdrive_t *vdrive, unsigned int unit)
/* init buffers */
for (i = 0; i < 15; i++) {
vdrive->buffers[i].mode = BUFFER_NOT_IN_USE;
#ifdef __LIBRETRO__
/* if buffer has been allocated previously,
* ensure it is freed before resetting the
* pointer to NULL */
if (vdrive->buffers[i].buffer) {
lib_free(vdrive->buffers[i].buffer);
}
#endif
vdrive->buffers[i].buffer = NULL;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment