linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] e2image: fix resource leak when running e2image -n
@ 2014-01-03  5:29 Theodore Ts'o
  2014-01-03  5:29 ` [PATCH 2/5] e2image: eliminate division by zero Theodore Ts'o
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Theodore Ts'o @ 2014-01-03  5:29 UTC (permalink / raw)
  To: Ext4 Developers List; +Cc: Theodore Ts'o

Addresses-Coverity-ID: #1147783

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
 misc/e2image.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/misc/e2image.c b/misc/e2image.c
index ab6a4fa..253fad1 100644
--- a/misc/e2image.c
+++ b/misc/e2image.c
@@ -174,7 +174,7 @@ static void generic_write(int fd, void *buf, int blocksize, blk64_t block)
 		printf(_("Writing block %llu\n"), (unsigned long long) block);
 		if (fd != 1)
 			seek_relative(fd, blocksize);
-		return;
+		goto free_and_return;
 	}
 	count = write(fd, buf, blocksize);
 	if (count != blocksize) {
@@ -191,6 +191,7 @@ static void generic_write(int fd, void *buf, int blocksize, blk64_t block)
 
 		exit(1);
 	}
+free_and_return:
 	if (free_buf)
 		ext2fs_free_mem(&buf);
 }
-- 
1.8.5.rc3.362.gdf10213


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

end of thread, other threads:[~2014-01-03 16:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-03  5:29 [PATCH 1/5] e2image: fix resource leak when running e2image -n Theodore Ts'o
2014-01-03  5:29 ` [PATCH 2/5] e2image: eliminate division by zero Theodore Ts'o
2014-01-03 16:40   ` Eric Sandeen
2014-01-03  5:29 ` [PATCH 3/5] e2image: avoid potential divide " Theodore Ts'o
2014-01-03 16:42   ` Eric Sandeen
2014-01-03  5:29 ` [PATCH 4/5] libblkid: fix sizeof(foo) vs sizeof(*foo) malloc() bug Theodore Ts'o
2014-01-03 16:44   ` Eric Sandeen
2014-01-03  5:29 ` [PATCH 5/5] subst: clean up various coverity nits Theodore Ts'o
2014-01-03 16:32 ` [PATCH 1/5] e2image: fix resource leak when running e2image -n Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).