check if the path is null. 48/90148/2
authorKonstantin Drabeniuk <k.drabeniuk@samsung.com>
Wed, 28 Sep 2016 13:37:30 +0000 (16:37 +0300)
committerSooChan Lim <sc1.lim@samsung.com>
Thu, 29 Sep 2016 00:48:14 +0000 (09:48 +0900)
fix build error

Change-Id: I9c1f8554c90443a16a877f7c06d1ea9f7bf21bfc
Signed-off-by: Konstantin Drabeniuk <k.drabeniuk@samsung.com>
src/tdm.c

index 5bf0f44eca50217024c1c8dbf9b21f7d8b104577..d9d8d07bba6a8ca599f86879e6c674ef61436f33 100644 (file)
--- a/src/tdm.c
+++ b/src/tdm.c
@@ -1053,7 +1053,7 @@ INTERN tdm_error
 tdm_display_enable_dump(tdm_private_display *private_display, const char *dump_str, char *reply, int *len)
 {
        char temp[TDM_PATH_LEN] = {0,}, temp2[TDM_PATH_LEN] = {0,};
-       char *path, *path2;
+       char *path = NULL, *path2;
        char *arg;
        char *end;
 
@@ -1131,7 +1131,9 @@ tdm_display_enable_dump(tdm_private_display *private_display, const char *dump_s
        TDM_INFO("dump... '%s'", dump_str);
 
 done:
-       free(path);
+       if (path)
+               free(path);
+
        return TDM_ERROR_NONE;
 }