From df6a1ee118fe9cc23ba937f732c8b89d5922b640 Mon Sep 17 00:00:00 2001 From: Konstantin Drabeniuk Date: Wed, 28 Sep 2016 16:37:30 +0300 Subject: [PATCH] check if the path is null. fix build error Change-Id: I9c1f8554c90443a16a877f7c06d1ea9f7bf21bfc Signed-off-by: Konstantin Drabeniuk --- src/tdm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tdm.c b/src/tdm.c index 5bf0f44..d9d8d07 100644 --- 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; } -- 2.7.4