SmartFS: Fix a 32-byte memory leak

This commit is contained in:
Ken Pettit 2016-07-12 17:28:06 -06:00 committed by Gregory Nutt
parent 6be72272eb
commit b616918e0f

View File

@ -1691,6 +1691,11 @@ static int smartfs_unlink(struct inode *mountpt, const char *relpath)
ret = OK; ret = OK;
errout_with_semaphore: errout_with_semaphore:
if (entry.name != NULL)
{
kmm_free(entry.name);
}
smartfs_semgive(fs); smartfs_semgive(fs);
return ret; return ret;
} }
@ -1856,6 +1861,11 @@ int smartfs_rmdir(struct inode *mountpt, const char *relpath)
ret = OK; ret = OK;
errout_with_semaphore: errout_with_semaphore:
if (entry.name != NULL)
{
kmm_free(entry.name);
}
smartfs_semgive(fs); smartfs_semgive(fs);
return ret; return ret;
} }