diff options
author | Davidlohr Bueso | 2011-07-24 17:29:23 +0200 |
---|---|---|
committer | Karel Zak | 2011-07-26 11:58:38 +0200 |
commit | 4190aaf619c6984226a9916fbb4bde3c70c3f2b4 (patch) | |
tree | 4819a060310e5493b786f78a50b5cc61df9ef999 /partx/partx.c | |
parent | sysfs: free used resources (diff) | |
download | kernel-qcow2-util-linux-4190aaf619c6984226a9916fbb4bde3c70c3f2b4.tar.gz kernel-qcow2-util-linux-4190aaf619c6984226a9916fbb4bde3c70c3f2b4.tar.xz kernel-qcow2-util-linux-4190aaf619c6984226a9916fbb4bde3c70c3f2b4.zip |
partx: use sysfs_deinit
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>
Diffstat (limited to 'partx/partx.c')
-rw-r--r-- | partx/partx.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/partx/partx.c b/partx/partx.c index e29e50dcc..4f827a822 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); |