ecore-drm: cleanup data when failed to setup tty.

Summary: added code to free string of tty's name when failed to setup tty.

@fix

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1763
This commit is contained in:
Seunghun Lee 2014-12-10 08:02:45 -05:00 committed by Chris Michael
parent 8b573930c7
commit 7ac4020874
2 changed files with 10 additions and 0 deletions

View File

@ -204,6 +204,11 @@ _ecore_drm_logind_vt_open(Ecore_Drm_Device *dev, const char *name)
{
close(dev->tty.fd);
dev->tty.fd = -1;
if (dev->tty.name)
{
eina_stringshare_del(dev->tty.name);
dev->tty.name = NULL;
}
return EINA_FALSE;
}

View File

@ -230,6 +230,11 @@ ecore_drm_tty_open(Ecore_Drm_Device *dev, const char *name)
{
close(dev->tty.fd);
dev->tty.fd = -1;
if (dev->tty.name)
{
eina_stringshare_del(dev->tty.name);
dev->tty.name = NULL;
}
return EINA_FALSE;
}