From: Hoyub Lee Date: Mon, 13 Feb 2017 04:20:51 +0000 (+0900) Subject: pepper: Fix possible memory leak path X-Git-Tag: submit/tizen/20170215.123502~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2fa35fbf5b88da36db2108d1a96742b2b1150e6a;p=platform%2Fcore%2Fuifw%2Fpepper.git pepper: Fix possible memory leak path Change-Id: I3df142212d2a8565b7e78c44fa80d9306bf83edf Signed-off-by: Hoyub Lee --- diff --git a/src/lib/pepper/utils-log.c b/src/lib/pepper/utils-log.c index 80f03aa..94b523f 100644 --- a/src/lib/pepper/utils-log.c +++ b/src/lib/pepper/utils-log.c @@ -56,8 +56,10 @@ pepper_print_timestamp(void) if (!brokendown_time) return fprintf(pepper_log_file, "failed to calloc for brokendown_time\n"); - if (!localtime_r(&tv.tv_sec, brokendown_time)) + if (!localtime_r(&tv.tv_sec, brokendown_time)) { + free(brokendown_time); return fprintf(pepper_log_file, "[(NULL)localtime] "); + } if (brokendown_time->tm_mday != cached_tm_mday) { strftime(string, sizeof string, "%Y-%m-%d %Z", brokendown_time);