From: Yu Watanabe Date: Sun, 25 Nov 2018 20:24:55 +0000 (+0900) Subject: journal-upload: use _cleanup_ attribute to clear uploader X-Git-Tag: v240~107^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9ed608679b26d05782d43a571da2979b537389e;p=thirdparty%2Fsystemd.git journal-upload: use _cleanup_ attribute to clear uploader --- diff --git a/src/journal-remote/journal-upload.c b/src/journal-remote/journal-upload.c index 7f08809c544..fd282ca19c8 100644 --- a/src/journal-remote/journal-upload.c +++ b/src/journal-remote/journal-upload.c @@ -762,7 +762,7 @@ static int open_journal(sd_journal **j) { } int main(int argc, char **argv) { - Uploader u; + _cleanup_(destroy_uploader) Uploader u = {}; int r; bool use_journal; @@ -853,8 +853,6 @@ cleanup: "STOPPING=1\n" "STATUS=Shutting down..."); - destroy_uploader(&u); - finish: return r >= 0 ? EXIT_SUCCESS : EXIT_FAILURE; }