From: Chih-Hung Hsieh Date: Fri, 12 Feb 2016 19:32:33 +0000 (-0800) Subject: Fix clang warnings and leak of full_stats_file . X-Git-Tag: android-x86-8.1-r1~68^2~360^2~40^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=41020e1b6c10761f81c0cadb861675b5202c3d2f;p=android-x86%2Fsystem-extras.git Fix clang warnings and leak of full_stats_file . BUG: 27121040 Change-Id: I33a218c7746509278e1222cd5dbd6d4876405b28 --- diff --git a/tests/ext4/rand_emmc_perf.c b/tests/ext4/rand_emmc_perf.c index ebd10c89..fed7a549 100644 --- a/tests/ext4/rand_emmc_perf.c +++ b/tests/ext4/rand_emmc_perf.c @@ -51,8 +51,8 @@ static void print_stats(struct stats *stats_buf, int stats_count, { int i; struct timeval t; - struct timeval sum = { 0 }; - struct timeval max = { 0 }; + struct timeval sum = { 0, 0 }; + struct timeval max = { 0, 0 }; long long total_usecs; long long avg_usecs; long long max_usecs; @@ -217,6 +217,7 @@ int main(int argc, char *argv[]) break; case 'f': + free(full_stats_file); full_stats_file = strdup(optarg); if (full_stats_file == NULL) { fprintf(stderr, "Cannot get full stats filename\n"); @@ -258,6 +259,7 @@ int main(int argc, char *argv[]) } else { perf_test(fd, write_mode, max_blocks); } + free(full_stats_file); exit(0); }