summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChih-hung Hsieh <chh@google.com>2016-02-12 20:02:48 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-02-12 20:02:48 +0000
commita72dd92554fd9fbadbddbf1ad2dcd308f6de7fff (patch)
treec330a38455db36c13a702b83228e7e4879dd8aba
parentdc0cfc06dfb1824851a5be66e60ece97d4a012b8 (diff)
parent41020e1b6c10761f81c0cadb861675b5202c3d2f (diff)
downloadextras-a72dd92554fd9fbadbddbf1ad2dcd308f6de7fff.tar.gz
Merge "Fix clang warnings and leak of full_stats_file ."
-rw-r--r--tests/ext4/rand_emmc_perf.c6
1 files changed, 4 insertions, 2 deletions
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);
}