[Jfs-patches] [PATCH] [CHECKER] Memory leak in jfs_link (2 of 3)
Brought to you by:
blaschke-oss,
shaggyk
From: <sh...@au...> - 2004-05-04 23:06:46
|
# This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/05/04 14:20:12-05:00 sh...@au... # JFS: [CHECKER] Memory leak in jfs_link # diff -Nru a/fs/jfs/namei.c b/fs/jfs/namei.c --- a/fs/jfs/namei.c Tue May 4 15:04:39 2004 +++ b/fs/jfs/namei.c Tue May 4 15:04:39 2004 @@ -792,14 +792,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 */ @@ -811,6 +811,9 @@ iplist[0] = ip; iplist[1] = dir; rc = txCommit(tid, 2, &iplist[0], 0); + + free_dname: + free_UCSname(&dname); out: txEnd(tid); |