From eb3a68448aca2b49d4c6ad983c84efe89078965d Mon Sep 17 00:00:00 2001 From: Boram Park Date: Mon, 28 Oct 2013 13:46:41 +0900 Subject: [PATCH] fix prevent bug Change-Id: Ib6a4f45d867f34cebba60cb10a28e0a6f3bb606b --- x11.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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; -- 2.7.4