mirror of
https://github.com/apache/nuttx.git
synced 2025-12-06 17:23:49 +08:00
graphics/nxterm: Avoid accessing freed memory
Fix accessing freed priv data.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user