ecore: Fix coverity resource leak
authorChris Michael <cp.michael@samsung.com>
Wed, 12 Jul 2017 14:58:28 +0000 (10:58 -0400)
committerChris Michael <cp.michael@samsung.com>
Wed, 12 Jul 2017 14:58:28 +0000 (10:58 -0400)
Coverity CID1377544 reports that poller is leaked here if we error out
and return null. As poller is created with calloc, we should free it
before returning.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/lib/ecore/ecore_poller.c

index b5567bc..b46f0df 100644 (file)
@@ -254,6 +254,7 @@ ecore_poller_add(Ecore_Poller_Type type EINA_UNUSED,
    if (!func)
      {
         ERR("callback function must be set up for an object of class: '%s'", MY_CLASS_NAME);
+        free(poller);
         return NULL;
      }