e_zone: check if private of zone is null 77/309277/1
authorSooChan Lim <sc1.lim@samsung.com>
Mon, 8 Apr 2024 04:22:19 +0000 (13:22 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Mon, 8 Apr 2024 07:24:28 +0000 (16:24 +0900)
return error when private is null

Change-Id: I65404964578d3a21f53d8c15135855dda85e0362

src/bin/e_zone.c

index 97ac391..1469f54 100644 (file)
 
 #define API_ENTRY \
    EINA_SAFETY_ON_NULL_RETURN(zone); \
-   E_Zone_Private *priv = PRI(zone)
+   E_Zone_Private *priv = PRI(zone); \
+   EINA_SAFETY_ON_NULL_RETURN(priv);
 
 #define API_ENTRY_VAL(ret) \
    EINA_SAFETY_ON_NULL_RETURN_VAL(zone, ret); \
-   E_Zone_Private *priv = PRI(zone)
+   E_Zone_Private *priv = PRI(zone) \
+   EINA_SAFETY_ON_NULL_RETURN_VAL(priv, ret);
 
 typedef struct _E_Zone_Private E_Zone_Private;
 typedef struct _E_Zone_Private_Client E_Zone_Private_Client;
@@ -146,6 +148,8 @@ _e_zone_private_finish(E_Zone *zone)
    E_Zone_Private *priv;
 
    priv = PRI(zone);
+   if (!priv) return;
+
    e_object_data_set(E_OBJECT(zone), NULL);
 
    wl_list_remove(&priv->screen_get_splitscreen.link);
@@ -2151,6 +2155,11 @@ e_zone_screen_new(int num, int w, int h)
   EINA_SAFETY_ON_NULL_RETURN_VAL(zone, NULL);
 
   priv = PRI(zone);
+  if (!priv)
+    {
+      e_object_del(E_OBJECT(zone));
+      return NULL;
+    }
 
   priv->tizen_screen = ds_tizen_screen_create(e_comp_wl->wl.disp);
   EINA_SAFETY_ON_NULL_RETURN_VAL(priv->tizen_screen, NULL);