ctxpopup: delete objects when failed to create
[profile/tv/apps/native/air_mediahub.git] / src / util / ctxpopup.c
index 34ded20..c70f808 100644 (file)
@@ -148,6 +148,8 @@ struct ctxpopup *ctxpopup_create(Evas_Object *base, const char *ctxpopup_style,
        box = util_add_box(ctxpopup, EINA_FALSE);
        if (!box) {
                _ERR("failed to add box");
+               evas_object_del(ctxpopup);
+               free(m);
                return false;
        }
 
@@ -158,6 +160,7 @@ struct ctxpopup *ctxpopup_create(Evas_Object *base, const char *ctxpopup_style,
                if (!btn) {
                        _ERR("failed to add button");
                        evas_object_del(ctxpopup);
+                       free(m);
                        return false;
                }