partx: use sysfs_deinit
PATCH 1/1 partx: use sysfs_deinit
From: Davidlohr Bueso <[email protected]>
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 <[email protected]>
--- partx/partx.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
partx/partx.c +3 -1
@@ -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);
Signature · 1 line
1.7.4.1
Quoted 2 lines · Davidlohr Bueso
partx/partx.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
Applied, thanks.
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com