ecore_evas_extn: do not double close fd in case of memory starvation.
authorCedric BAIL <c.bail@partner.samsung.com>
Wed, 30 Jul 2014 01:47:31 +0000 (03:47 +0200)
committerCedric BAIL <c.bail@partner.samsung.com>
Wed, 30 Jul 2014 01:47:31 +0000 (03:47 +0200)
In case eina_stringshare_add was failing it could lead to a double close
on lockfd. This was reported by coverity: CID1039885

@fix

src/modules/ecore_evas/engines/extn/ecore_evas_extn_buf.c

index 017cf33..31f83dc 100644 (file)
@@ -158,6 +158,7 @@ _extnbuf_lock_file_set(Extnbuf *b, const char *file)
    if (b->am_owner) return EINA_FALSE;
    if (b->lock) eina_stringshare_del(b->lock);
    if (b->lockfd >= 0) close(b->lockfd);
+   b->lockfd = -1;
    if (!file)
      {
         b->lock = NULL;