[sheepdog] [PATCH 2/2] object cache: fix memory leak in object_cache_lookup()

Liu Yuan namei.unix at gmail.com
Thu Aug 2 05:43:04 CEST 2012


From: Liu Yuan <tailai.ly at taobao.com>

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/object_cache.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sheep/object_cache.c b/sheep/object_cache.c
index 3b6ecbe..222e797 100644
--- a/sheep/object_cache.c
+++ b/sheep/object_cache.c
@@ -661,9 +661,8 @@ static int object_cache_lookup(struct object_cache *oc, uint32_t idx,
 			} else {
 				ret = SD_RES_NO_CACHE;
 			}
-			return ret;
 		}
-		return ret;
+		goto out;
 	}
 
 	flags |= O_CREAT | O_TRUNC;
-- 
1.7.10.2




More information about the sheepdog mailing list