[sheepdog] [PATCH] sheep: initialize buffer in recover_object_from_replica

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Sep 18 10:49:55 CEST 2012


This is necessary to call free safely when the target object is in the
local node.

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

diff --git a/sheep/recovery.c b/sheep/recovery.c
index c263d5d..dec9688 100644
--- a/sheep/recovery.c
+++ b/sheep/recovery.c
@@ -66,7 +66,7 @@ static int recover_object_from_replica(uint64_t oid, struct sd_vnode *vnode,
 	struct sd_req hdr;
 	unsigned wlen = 0, rlen;
 	int ret = SD_RES_NO_MEM;
-	void *buf;
+	void *buf = NULL;
 	struct siocb iocb = { 0 };
 
 	rlen = get_objsize(oid);
-- 
1.7.2.5




More information about the sheepdog mailing list