e_service_quickpanel: fix bug detected by static analysis tool
authorDoyoun Kang <doyoun.kang@samsung.com>
Mon, 17 Jul 2017 11:08:38 +0000 (20:08 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Tue, 18 Jul 2017 02:25:10 +0000 (11:25 +0900)
Change-Id: I7f2570e8d55dc1316456730381a4fef409e6cbb6

src/bin/services/e_service_quickpanel.c

index 9a42cd62824c40d5b73d4fcce505a436e493fd52..e23e609508b7db3dcd38879240fddc206782125a 100644 (file)
@@ -514,22 +514,22 @@ _e_qp_srv_effect_finish_job_start(E_Policy_Quickpanel *qp, Eina_Bool visible)
       case E_POLICY_ANGLE_MAP_90:
          from = qp->effect.x;
          to = (visible) ? (ec->zone->w - from) : (-from);
-         duration = ((double)abs(to) / (ec->zone->w / 2)) * ref;
+         duration = ((double)abs(to) / ((double)ec->zone->w / 2)) * ref;
          break;
       case E_POLICY_ANGLE_MAP_180:
          from = qp->effect.y;
          to = (visible) ? (-from) : (ec->zone->h - from);
-         duration = ((double)abs(to) / (ec->zone->h / 2)) * ref;
+         duration = ((double)abs(to) / ((double)ec->zone->h / 2)) * ref;
          break;
       case E_POLICY_ANGLE_MAP_270:
          from = qp->effect.x;
          to = (visible) ? (-from) : (ec->zone->w - from);
-         duration = ((double)abs(to) / (ec->zone->w / 2)) * ref;
+         duration = ((double)abs(to) / ((double)ec->zone->w / 2)) * ref;
          break;
       default:
          from = qp->effect.y;
          to = (visible) ? (ec->zone->h - from) : (-from);
-         duration = ((double)abs(to) / (ec->zone->h / 2)) * ref;
+         duration = ((double)abs(to) / ((double)ec->zone->h / 2)) * ref;
          break;
      }
 
@@ -1860,6 +1860,8 @@ e_qp_client_add(E_Client *ec)
      }
 
    qp_client = E_NEW(E_QP_Client, 1);
+   EINA_SAFETY_ON_NULL_RETURN(qp_client);
+
    qp_client->ec = ec;
    qp_client->ref = 1;
    qp_client->hint.vis = EINA_TRUE;