graphics/nxterm: Avoid accessing freed memory

Fix accessing freed priv data.
This commit is contained in:
SPRESENSE 2022-04-11 18:46:59 +09:00 committed by Xiang Xiao
parent 8dd5d0d510
commit 46a92aeebb
1 changed files with 4 additions and 0 deletions

View File

@ -166,7 +166,9 @@ static int nxterm_close(FAR struct file *filep)
{
/* Yes.. Unregister the terminal device */
nxterm_sempost(priv);
nxterm_unregister(priv);
return OK;
}
else
{
@ -346,7 +348,9 @@ static int nxterm_unlink(FAR struct inode *inode)
{
/* No.. Unregister the terminal device now */
nxterm_sempost(priv);
nxterm_unregister(priv);
return OK;
}
nxterm_sempost(priv);