]> git.hungrycats.org Git - linux/commitdiff
JFS: [CHECKER] Memory leak in jfs_link
authorDave Kleikamp <shaggy@austin.ibm.com>
Tue, 4 May 2004 09:20:12 +0000 (04:20 -0500)
committerDave Kleikamp <shaggy@austin.ibm.com>
Tue, 4 May 2004 09:20:12 +0000 (04:20 -0500)
fs/jfs/namei.c

index 0e48668e00d7a48ae78768521cf51aa0534a5f05..abfe33f8c19ae032d93f11a87468f933ea98c90c 100644 (file)
@@ -792,14 +792,14 @@ static int jfs_link(struct dentry *old_dentry,
                goto out;
 
        if ((rc = dtSearch(dir, &dname, &ino, &btstack, JFS_CREATE)))
-               goto out;
+               goto free_dname;
 
        /*
         * create entry for new link in parent directory
         */
        ino = ip->i_ino;
        if ((rc = dtInsert(tid, dir, &dname, &ino, &btstack)))
-               goto out;
+               goto free_dname;
 
        /* update object inode */
        ip->i_nlink++;          /* for new link */
@@ -812,6 +812,9 @@ static int jfs_link(struct dentry *old_dentry,
        iplist[1] = dir;
        rc = txCommit(tid, 2, &iplist[0], 0);
 
+      free_dname:
+       free_UCSname(&dname);
+
       out:
        txEnd(tid);