From e6489867518b0a1e7842fe5baf29cb5b86a4d3cb Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 19 Nov 2009 16:03:30 -0800 Subject: [PATCH] auth: set initial values in misc structs Fixes a bunch of valgrind warnings. --- src/auth/Auth.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/auth/Auth.h b/src/auth/Auth.h index f55d432adee19..f5ad358cbc84f 100644 --- a/src/auth/Auth.h +++ b/src/auth/Auth.h @@ -127,7 +127,9 @@ struct AuthCapsInfo { bool allow_all; bufferlist caps; - void encode(bufferlist& bl) const { + AuthCapsInfo() : allow_all(false) {} + + void encode(bufferlist& bl) const { uint32_t a = (uint32_t)allow_all; ::encode(a, bl); ::encode(caps, bl); @@ -153,7 +155,7 @@ struct AuthTicket { AuthCapsInfo caps; __u32 flags; - AuthTicket() : flags(0) {} + AuthTicket() : global_id(0), flags(0) {} void init_timestamps(utime_t now, double ttl) { created = now; @@ -224,6 +226,8 @@ struct RotatingSecrets { map secrets; version_t max_ver; + RotatingSecrets() : max_ver(0) {} + void encode(bufferlist& bl) const { ::encode(secrets, bl); ::encode(max_ver, bl); -- 2.39.5