[sheepdog] [PATCH] recovery: initialize recovery_state

MORITA Kazutaka morita.kazutaka at gmail.com
Fri Aug 16 21:52:08 CEST 2013


From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>

This prevents dog from reading uninitialize data and fixes a valgrind
error of functional tests.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 sheep/recovery.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/sheep/recovery.c b/sheep/recovery.c
index 1b5adc1..e734b88 100644
--- a/sheep/recovery.c
+++ b/sheep/recovery.c
@@ -872,6 +872,8 @@ void get_recovery_state(struct recovery_state *state)
 {
 	struct recovery_info *rinfo = main_thread_get(current_rinfo);
 
+	memset(state, 0, sizeof(*state));
+
 	if (!rinfo) {
 		state->in_recovery = 0;
 		return;
-- 
1.7.9.5




More information about the sheepdog mailing list