public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix leaks in ISOFS.
@ 2004-09-01 15:51 Dave Jones
  2004-09-01 17:00 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Jones @ 2004-09-01 15:51 UTC (permalink / raw)
  To: linux-kernel

Spotted with the source checker from Coverity.com.

Signed-off-by: Dave Jones <davej@redhat.com>


diff -urpN --exclude-from=/home/davej/.exclude bk-linus/fs/isofs/rock.c linux-2.6/fs/isofs/rock.c
--- bk-linus/fs/isofs/rock.c	2004-07-01 17:44:12.000000000 +0100
+++ linux-2.6/fs/isofs/rock.c	2004-08-23 14:08:20.000000000 +0100
@@ -153,6 +153,7 @@ int get_rock_ridge_filename(struct iso_d
     }
   }
   MAYBE_CONTINUE(repeat,inode);
+  if (buffer) kfree(buffer);
   return retnamlen; /* If 0, this file did not have a NM field */
  out:
   if(buffer) kfree(buffer);
@@ -351,7 +352,6 @@ int parse_rock_ridge_inode_internal(stru
     }
   }
   MAYBE_CONTINUE(repeat,inode);
-  return 0;
  out:
   if(buffer) kfree(buffer);
   return 0;
@@ -515,6 +515,8 @@ static int rock_ridge_symlink_readpage(s
 		}
 	}
 	MAYBE_CONTINUE(repeat, inode);
+	if (buffer)
+		kfree(buffer);
 
 	if (rpnt == link)
 		goto fail;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix leaks in ISOFS.
  2004-09-01 15:51 [PATCH] Fix leaks in ISOFS Dave Jones
@ 2004-09-01 17:00 ` Christoph Hellwig
  2004-09-01 20:41   ` Dave Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2004-09-01 17:00 UTC (permalink / raw)
  To: Dave Jones; +Cc: linux-kernel

>    MAYBE_CONTINUE(repeat,inode);
> +  if (buffer) kfree(buffer);

kfree(NULL) is just fine


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix leaks in ISOFS.
  2004-09-01 17:00 ` Christoph Hellwig
@ 2004-09-01 20:41   ` Dave Jones
  0 siblings, 0 replies; 3+ messages in thread
From: Dave Jones @ 2004-09-01 20:41 UTC (permalink / raw)
  To: Christoph Hellwig, linux-kernel

On Wed, Sep 01, 2004 at 06:00:50PM +0100, Christoph Hellwig wrote:
 > >    MAYBE_CONTINUE(repeat,inode);
 > > +  if (buffer) kfree(buffer);
 > 
 > kfree(NULL) is just fine

True. I got carried away mirroring the style of all the other
kfree operations in that code.

		Dave


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-09-01 20:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-01 15:51 [PATCH] Fix leaks in ISOFS Dave Jones
2004-09-01 17:00 ` Christoph Hellwig
2004-09-01 20:41   ` Dave Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox