Skip to content

Commit

Permalink
Fix a memory leak in error path
Browse files Browse the repository at this point in the history
  • Loading branch information
rojer committed Dec 5, 2020
1 parent 68c0482 commit 8317dc5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/mgos_vfs_fs_spiffs.c
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,7 @@ bool mgos_vfs_fs_spiffs_enc_fs(spiffs *spfs) {
buf_size &= ~(CS_SPIFFS_ENCRYPTION_BLOCK_SIZE - 1);
if ((buf = malloc(buf_size)) == NULL) goto out;
if (SPIFFS_opendir(spfs, "/", &d) == NULL) {
free(buf);
return false;
}
while (SPIFFS_readdir(&d, &e) != NULL) {
Expand Down

0 comments on commit 8317dc5

Please sign in to comment.