X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fumount.c;h=cffa45327be531784ac64cc9864c82ff622e4fe4;hb=e1d758033dc7e101ab32323a0f1649d8daf56a22;hp=a30f6740fada15b5b00214ede9e2173b0517ffe4;hpb=6ec60d20724d2a32e20d25ef75d2af178c242bc2;p=elogind.git diff --git a/src/core/umount.c b/src/core/umount.c index a30f6740f..cffa45327 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) {