From: Boram Park Date: Mon, 28 Oct 2013 04:46:41 +0000 (+0900) Subject: fix prevent bug X-Git-Tag: 2.2.1_release X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_2.2;p=framework%2Fuifw%2Fxorg%2Flibslp-utilx.git fix prevent bug Change-Id: Ib6a4f45d867f34cebba60cb10a28e0a6f3bb606b --- diff --git a/x11.c b/x11.c index af8f3c1..d34bf7d 100644 --- a/x11.c +++ b/x11.c @@ -1615,6 +1615,12 @@ _init_screen_shot_dri2 (ShotInfo *info) goto fail_init_dri2; } + if (!driverName || !deviceName) + { + fprintf (stderr, "[UTILX] fail : Get DRI info !!\n"); + goto fail_init_dri2; + } + /* drm_fd */ info->drm_fd = open (deviceName, O_RDWR); if (info->drm_fd < 0) @@ -1678,10 +1684,8 @@ _init_screen_shot_dri2 (ShotInfo *info) info->enable_xshm = False; - if (driverName) - free (driverName); - if (deviceName) - free (deviceName); + free (driverName); + free (deviceName); return True;