X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fhostname-setup.c;fp=src%2Fcore%2Fhostname-setup.c;h=120024065a036551573b00f3d8ca438eedee2fe1;hb=2fbe635a83a79f8889afec421ae3990ea106fb91;hp=25ea09c733d3070e2e5479d43ad499be8a9f24ad;hpb=a1d41e17a5c3861becd66f1c9dba7eb39ae4c478;p=elogind.git diff --git a/src/core/hostname-setup.c b/src/core/hostname-setup.c index 25ea09c73..120024065 100644 --- a/src/core/hostname-setup.c +++ b/src/core/hostname-setup.c @@ -67,7 +67,7 @@ static int read_distro_hostname(char **hn) { #if defined(TARGET_FEDORA) || defined(TARGET_ARCH) || defined(TARGET_GENTOO) || defined(TARGET_ALTLINUX) || defined(TARGET_MANDRIVA) || defined(TARGET_MAGEIA) int r; - FILE *f; + _cleanup_fclose_ FILE *f = NULL; assert(hn); @@ -114,7 +114,6 @@ static int read_distro_hostname(char **hn) { r = -ENOENT; finish: - fclose(f); return r; #elif defined(TARGET_SUSE) || defined(TARGET_SLACKWARE)