e_dbus/ofono: fix memory leak on test
authorbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 23 Mar 2010 19:05:19 +0000 (19:05 +0000)
committerbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 23 Mar 2010 19:05:19 +0000 (19:05 +0000)
By: João Paulo Rechi Vita <jprvita@profusion.mobi>

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/e_dbus@47398 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/bin/e_dbus_ofono_test.c

index b39edde..c60438c 100644 (file)
@@ -274,13 +274,14 @@ _on_cmd_manager_modems_get(char *cmd, char *args)
    char *path;
    Eina_Array_Iterator iterator;
    unsigned int i;
-   Eina_Array *modems = eina_array_new(1);
+   Eina_Array *modems = NULL;
 
    if(e_ofono_manager_modems_get(&modems))
      {
        printf("[");
-       EINA_ARRAY_ITER_NEXT(modems, i, path, iterator)
-          printf(" %s", path);
+       if (modems)
+         EINA_ARRAY_ITER_NEXT(modems, i, path, iterator)
+            printf(" %s", path);
        printf(" ]\n");
      }