diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-02-19 17:51:54 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-02-19 17:53:50 +0100 |
commit | 480a61ae742378a6a9a0eb84cf29c6c1e4ea22ff (patch) | |
tree | 5e9cdb602f0435c1ae667b553011f012a9d7c2d6 /src/timedate | |
parent | d4f1ef4437e59b2cb69a201bb086ab23070ea72d (diff) |
timedatectl: fix minor memory leak
Diffstat (limited to 'src/timedate')
-rw-r--r-- | src/timedate/timedatectl.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c index 2c24b78458..089a5fe3ef 100644 --- a/src/timedate/timedatectl.c +++ b/src/timedate/timedatectl.c @@ -99,10 +99,10 @@ static void print_status_info(const StatusInfo *i) { struct tm tm; time_t sec; bool have_time = false; - char *zc, *zn; + _cleanup_free_ char *zc = NULL, *zn = NULL; time_t t, tc, tn; - int dn; - bool is_dstc, is_dstn; + int dn = 0; + bool is_dstc = false, is_dstn = false; int r; assert(i); @@ -193,9 +193,6 @@ static void print_status_info(const StatusInfo *i) { " %s\n" " %s\n", is_dstn ? "begins" : "ends", jump_str(dn, s, sizeof(s)), a, b); - - free(zc); - free(zn); } else printf(" DST active: %s\n", yes_no(is_dstc)); |