From 8661f92deddc16c69b5e9f4fcebf98e66f64f771 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Mon, 11 Oct 2010 11:17:03 +0200 Subject: [PATCH] Initialize struct stat in error case correctly In the case stat failes to gather information about the log file, it has to initialize struct stat. Otherwise, we will set a random file size. --- src/stats.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/stats.c b/src/stats.c index b290c13..f646bac 100644 --- a/src/stats.c +++ b/src/stats.c @@ -270,6 +270,7 @@ static int stats_open_file(struct connman_service *service, err = stat(file->name, &st); if (err < 0) { /* according documentation the only possible error is ENOENT */ + st.st_size = 0; new_file = TRUE; } -- 2.7.4