Memory corruption fix.
This commit is contained in:
parent
bb054c28b4
commit
47ae458edd
|
@ -517,9 +517,11 @@ void deleteSaveSlot(int slot)
|
||||||
|
|
||||||
filenames = getFileList(path, &numFiles);
|
filenames = getFileList(path, &numFiles);
|
||||||
|
|
||||||
|
free(path);
|
||||||
|
|
||||||
for (i = 0 ; i < numFiles ; i++)
|
for (i = 0 ; i < numFiles ; i++)
|
||||||
{
|
{
|
||||||
sprintf(path, "%s/%d/%s", app.saveDir, slot, filenames[i]);
|
path = buildFormattedString("%s/%d/%s", app.saveDir, slot, filenames[i]);
|
||||||
|
|
||||||
if (!deleteFile(path))
|
if (!deleteFile(path))
|
||||||
{
|
{
|
||||||
|
@ -528,11 +530,11 @@ void deleteSaveSlot(int slot)
|
||||||
}
|
}
|
||||||
|
|
||||||
free(filenames[i]);
|
free(filenames[i]);
|
||||||
|
|
||||||
|
free(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(filenames);
|
free(filenames);
|
||||||
|
|
||||||
free(path);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sortItems(const void *a, const void *b)
|
static int sortItems(const void *a, const void *b)
|
||||||
|
|
Loading…
Reference in New Issue