summaryrefslogtreecommitdiff
path: root/src/core/umount.c
diff options
context:
space:
mode:
authorRonny Chevalier <chevalier.ronny@gmail.com>2014-06-24 19:00:32 +0200
committerTom Gundersen <teg@jklm.no>2014-06-24 19:09:57 +0200
commite1d758033dc7e101ab32323a0f1649d8daf56a22 (patch)
treea1688425a3c125569b34dc0e28318361245b2bc8 /src/core/umount.c
parent6ec60d20724d2a32e20d25ef75d2af178c242bc2 (diff)
use more _cleanup_ macro
Diffstat (limited to 'src/core/umount.c')
-rw-r--r--src/core/umount.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/core/umount.c b/src/core/umount.c
index a30f6740fa..cffa45327b 100644
--- a/src/core/umount.c
+++ b/src/core/umount.c
@@ -126,9 +126,8 @@ static int mount_points_list_get(MountPoint **head) {
}
static int swap_list_get(MountPoint **head) {
- FILE *proc_swaps;
+ _cleanup_fclose_ FILE *proc_swaps = NULL;
unsigned int i;
- int r;
assert(head);
@@ -168,26 +167,19 @@ static int swap_list_get(MountPoint **head) {
free(dev);
if (!d) {
- r = -ENOMEM;
- goto finish;
+ return -ENOMEM;
}
if (!(swap = new0(MountPoint, 1))) {
free(d);
- r = -ENOMEM;
- goto finish;
+ return -ENOMEM;
}
swap->path = d;
LIST_PREPEND(mount_point, *head, swap);
}
- r = 0;
-
-finish:
- fclose(proc_swaps);
-
- return r;
+ return 0;
}
static int loopback_list_get(MountPoint **head) {