eolian/generator: fix coverity issues
authorDaniel Kolesa <d.kolesa@samsung.com>
Wed, 23 Jul 2014 23:32:06 +0000 (00:32 +0100)
committerDaniel Kolesa <d.kolesa@samsung.com>
Wed, 23 Jul 2014 23:32:06 +0000 (00:32 +0100)
Fixes CID 1228663 and 1228634.

src/bin/eolian/impl_generator.c
src/bin/eolian/main.c

index 1043898..2b7aa2b 100644 (file)
@@ -275,7 +275,8 @@ impl_source_generate(const Eolian_Class *class, Eina_Strbuf *buffer)
      }
    eina_iterator_free(itr);
 
-   if (eolian_class_implements_get(class))
+   itr = eolian_class_implements_get(class);
+   if (itr)
      {
         Eolian_Implement *impl_desc;
         EINA_ITERATOR_FOREACH(itr, impl_desc)
index a50f745..c4c4974 100644 (file)
@@ -171,10 +171,9 @@ _generate_impl_c_file(char *filename, const Eolian_Class *class)
    if (eina_strbuf_string_get(buffer))
      fputs(eina_strbuf_string_get(buffer), fd);
 
-   fclose(fd);
-
    ret = EINA_TRUE;
 end:
+   fclose(fd);
    eina_strbuf_free(buffer);
 
    return ret;