e_mod_configured_resolution: destroy pkgmgrinfo handler after using it 49/258749/2
authorJunseok, Kim <juns.kim@samsung.com>
Tue, 25 May 2021 06:25:08 +0000 (15:25 +0900)
committerJunseok, Kim <juns.kim@samsung.com>
Tue, 25 May 2021 07:12:09 +0000 (16:12 +0900)
Change-Id: I99b9d67568fd13bf6758aab5b97dfa666676ff1b
Signed-off-by: Junseok, Kim <juns.kim@samsung.com>
src/e_mod_configured_resolution.c

index f4ba0b2..333541d 100644 (file)
@@ -24,14 +24,14 @@ _e_wm_policy_cb_base_output_resolution_get(void *data, pid_t pid)
    if (ret < 0)
      {
         ELOGF("CONFIGURED_RES", "APP_ID_GET|failed to get appid", NULL);
-        return;
+        goto fin;
      }
 
    ret = pkgmgrinfo_appinfo_get_appinfo(appid, &appinfo);
    if (ret != PMINFO_R_OK || appinfo == NULL)
      {
         ELOGF("CONFIGURED_RES", "PKG_INFO_GET|failed to get appinfo", NULL);
-        return;
+        goto fin;
      }
 
    ret = pkgmgrinfo_appinfo_get_metadata_value(appinfo,
@@ -41,7 +41,7 @@ _e_wm_policy_cb_base_output_resolution_get(void *data, pid_t pid)
    if (ret != PMINFO_R_OK || resolution == NULL)
      {
         ELOGF("CONFIGURED_RES", "MEAT_DATA_GET|failed to get metadata", NULL);
-        return;
+        goto fin;
      }
 
    ELOGF("CONFIGURED_RES", "screen size(%dx%d), user apptype(%s)", NULL,
@@ -65,16 +65,20 @@ _e_wm_policy_cb_base_output_resolution_get(void *data, pid_t pid)
    if (!epai)
      {
         ELOGF("CONFIGURED_RES", "APPINFO_GET|fail to find pid.(pid:%d)", NULL, pid);
-        return;
+        goto fin;
      }
 
    if (!e_appinfo_base_output_resolution_set(epai, width, height))
      {
         ELOGF("CONFIGURED_RES", "RESOLUTION_SET|fail to set base_output_resolution (pid:%d)", NULL, pid);
-        return;
+        goto fin;
      }
 
    ELOGF("CONFIGURED_RES", "RESOLUTION_SET|SET base_output_resolution(%d, %d) (pid:%d)", NULL, width, height, pid);
+
+fin:
+   if (appinfo)
+     pkgmgrinfo_appinfo_destroy_appinfo(appinfo);
 }
 
 EINTERN void