Util-Linux package development
 help / color / mirror / Atom feed
* [PATCH] partx: use sysfs_deinit
@ 2011-07-24 22:51 Davidlohr Bueso
  2011-07-26 10:14 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Davidlohr Bueso @ 2011-07-24 22:51 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux

From: Davidlohr Bueso <dave@gnu.org>
Date: Sun, 24 Jul 2011 11:29:23 -0400


Commit a88268b8cc124b6f721ba17ab01a3f6d5800c749 (get partition number with sysfs lib) recently added the sysfs library to partx without freeing resources once finished.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
---
 partx/partx.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/partx/partx.c b/partx/partx.c
index e29e50d..4f827a8 100644
--- a/partx/partx.c
+++ b/partx/partx.c
@@ -137,8 +137,10 @@ static int get_partno_from_device(char *partition, dev_t devno)
 		struct sysfs_cxt cxt;
 
 		sysfs_init(&cxt, devno, NULL);
-		if (sysfs_read_int(&cxt, "partition", &partno) >= 0)
+		if (sysfs_read_int(&cxt, "partition", &partno) >= 0) {
+			sysfs_deinit(&cxt);
 			return partno;
+		}
 	}
 
 	sz = strlen(partition);
-- 
1.7.4.1

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

* Re: [PATCH] partx: use sysfs_deinit
  2011-07-24 22:51 [PATCH] partx: use sysfs_deinit Davidlohr Bueso
@ 2011-07-26 10:14 ` Karel Zak
  0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2011-07-26 10:14 UTC (permalink / raw)
  To: Davidlohr Bueso; +Cc: util-linux

On Sun, Jul 24, 2011 at 06:51:16PM -0400, Davidlohr Bueso wrote:
>  partx/partx.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)

 Applied, thanks.

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

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

end of thread, other threads:[~2011-07-26 10:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-24 22:51 [PATCH] partx: use sysfs_deinit Davidlohr Bueso
2011-07-26 10:14 ` Karel Zak

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