]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
FuseStore: fix memory leak
authorxie xingguo <xie.xingguo@zte.com.cn>
Thu, 28 Jan 2016 09:30:20 +0000 (17:30 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Fri, 29 Jan 2016 02:26:14 +0000 (10:26 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/FuseStore.cc

index 4d5d7e42b39fa1909eb714fd19348cbe86479d62..de83f1e319861d7698572c1305d101f293ef0e21 100644 (file)
@@ -544,7 +544,6 @@ static int os_open(const char *path, struct fuse_file_info *fi)
 
   case FN_HASH_END:
     {
-      pbl = new bufferlist;
       spg_t pgid;
       unsigned long h;
       if (cid.is_pg(&pgid)) {
@@ -561,6 +560,7 @@ static int os_open(const char *path, struct fuse_file_info *fi)
       }
       char buf[10];
       snprintf(buf, sizeof(buf), "%08lx\n", h);
+      pbl = new bufferlist;
       pbl->append(buf);
     }
     break;