On Fri, 2004-04-30 at 17:31, Junfeng Yang wrote:
> get_UCSname is a memory allocation function.  Should call
> free_UCSname(&dname) to free the allocated memory

I'm embarrassed to see how long this one has gone undetected.  Here's a
patch.  I'll send these to Marcelo and Linus after more complete
testing.

===== fs/jfs/namei.c 1.22 vs edited =====
--- 1.22/fs/jfs/namei.c Wed Mar 24 14:55:56 2004
+++ edited/fs/jfs/namei.c       Tue May  4 12:54:00 2004
@@ -784,14 +784,14 @@
                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 */
@@ -803,6 +803,9 @@
        iplist[0] = ip;
        iplist[1] = dir;
        rc = txCommit(tid, 2, &iplist[0], 0);
+
+      free_dname:
+       free_UCSname(&dname);
 
       out:
        txEnd(tid);

-- 
David Kleikamp
IBM Linux Technology Center

_______________________________________________
Jfs-discussion mailing list
[EMAIL PROTECTED]
http://www-124.ibm.com/developerworks/oss/mailman/listinfo/jfs-discussion

Reply via email to