Skip to content

Commit

Permalink
fixed #18 issue: memory leak NES while load/save
Browse files Browse the repository at this point in the history
Signed-off-by: Fuji Pebri <[email protected]>
  • Loading branch information
pebri86 committed Nov 3, 2020
1 parent 6e9dffd commit f0f8449
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions esplay-nofrendo/components/nofrendo/libsnss/libsnss.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ SNSS_OpenFile (SNSS_FILE **snssFile, const char *filename, SNSS_OPEN_MODE mode)
*snssFile = malloc(sizeof(SNSS_FILE));
if (NULL == *snssFile)
{
abort();
//abort();
return SNSS_OUT_OF_MEMORY;
}

Expand Down Expand Up @@ -404,7 +404,7 @@ SNSS_ReadBaseBlock (SNSS_FILE *snssFile)
snssFile->baseBlock.vramAddress = swap16 (snssFile->baseBlock.vramAddress);
snssFile->baseBlock.spriteRamAddress = blockBytes[0x192F];
snssFile->baseBlock.tileXOffset = blockBytes[0x1930];

free(blockBytes);
return SNSS_OK;
}

Expand Down Expand Up @@ -457,7 +457,7 @@ SNSS_WriteBaseBlock (SNSS_FILE *snssFile)
}

snssFile->headerBlock.numberOfBlocks++;

free(blockBytes);
return SNSS_OK;
}

Expand Down

0 comments on commit f0f8449

Please sign in to comment.