]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: sysfs, free path after build_path
authorYehuda Sadeh <yehuda@hq.newdream.net>
Mon, 9 Mar 2009 21:55:54 +0000 (14:55 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Mon, 9 Mar 2009 21:55:54 +0000 (14:55 -0700)
src/kernel/sysfs.c

index cced3ab3f97145b41d429276c11db9efe91f78c7..37dda51a8aff965915962f853ee45b5d8bf69343 100644 (file)
@@ -216,16 +216,20 @@ static ssize_t req_op_show(struct ceph_mds_request *req,
 
        if (req->r_dentry) {
                path = ceph_mdsc_build_path(req->r_dentry, &pathlen, &pathbase, -1);
-               if (path)
+               if (path) {
                        pos += sprintf(buf+pos, " %s", path);
+                       kfree(path);
+               }
        } else if (req->r_path1) {
                pos += sprintf(buf+pos, " %s", req->r_path1);
        }
 
        if (req->r_old_dentry) {
                path = ceph_mdsc_build_path(req->r_old_dentry, &pathlen, &pathbase, -1);
-               if (path)
+               if (path) {
                        pos += sprintf(buf+pos, " %s", path);
+                       kfree(path);
+               }
        } else if (req->r_path2 &&
                   req->r_op != CEPH_MDS_OP_FINDINODE) {
                        pos += sprintf(buf+pos, " %s", req->r_path2);