e_foreign_shell: Fix leak of eina_iterator 82/263482/2
authorSeunghun Lee <chwila927@gmail.com>
Fri, 3 Sep 2021 07:18:43 +0000 (16:18 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Tue, 7 Sep 2021 00:30:37 +0000 (00:30 +0000)
Change-Id: I0c490d2defeadd932b819c338eb637b1ca3fc504

src/bin/e_foreign_shell.c

index 8484cc811973a00143207764872931fcd94d501f..b1fc3cc67df3b55176bbc5af9d827feb2a046381 100644 (file)
@@ -213,7 +213,7 @@ e_foreign_shell_import(struct wl_resource *importer, struct wl_resource *resourc
 static E_Exported_Shell *
 _e_exported_shell_find_by_surface(struct wl_resource *surface)
 {
-   E_Exported_Shell *es;
+   E_Exported_Shell *es, *ret = NULL;
    E_Client *ec;
    Eina_Iterator *it;
 
@@ -223,11 +223,14 @@ _e_exported_shell_find_by_surface(struct wl_resource *surface)
    EINA_ITERATOR_FOREACH(it, es)
      {
         if (es->ec == ec)
-          return es;
+          {
+             ret = es;
+             break;
+          }
      }
    eina_iterator_free(it);
 
-   return NULL;
+   return ret;
 }
 
 static E_Exported_Shell *