From mboxrd@z Thu Jan 1 00:00:00 1970 From: Renaud Barbier Date: Fri, 30 Sep 2011 17:42:52 +0100 Subject: [U-Boot] ubifs: memory possibly not freed Message-ID: <4E85F18C.9060904@ge.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Looking at the function ubifs_finddir in the file fs/ubifs/ubifs.c, I was wondering if some memory had not been freed before the function returns. 287 static int ubifs_finddir(struct super_block *sb, char *dirname, 288 unsigned long root_inum, unsigned long *inum) 289 { ... 299 file = kzalloc(sizeof(struct file), 0); 300 dentry = kzalloc(sizeof(struct dentry), 0); 301 dir = kzalloc(sizeof(struct inode), 0); .... 336 if ((strncmp(dirname, (char *)dent->name, nm.len) == 0) && 337 (strlen(dirname) == nm.len)) { 338 *inum = le64_to_cpu(dent->inum); 339 return 1; 340 } Line 339 returns without freeing file, dentry and dir. Maybe wrong but could somebody check that.