[sheepdog] [PATCH] sheep: use valloc for data object I/O
MORITA Kazutaka
morita.kazutaka at lab.ntt.co.jp
Wed May 22 07:49:41 CEST 2013
Otherwise, read/2 can return error with EINVAL.
Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
sheep/plain_store.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sheep/plain_store.c b/sheep/plain_store.c
index c8b7af5..b932d6a 100644
--- a/sheep/plain_store.c
+++ b/sheep/plain_store.c
@@ -543,7 +543,7 @@ int default_get_hash(uint64_t oid, uint32_t epoch, uint8_t *sha1)
}
length = get_objsize(oid);
- buf = malloc(length);
+ buf = valloc(length);
if (buf == NULL)
return SD_RES_NO_MEM;
--
1.8.1.3.566.gaa39828
More information about the sheepdog
mailing list