chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
timedatectl: fix minor memory leak
[elogind.git]
/
src
/
timedate
/
timedatectl.c
diff --git
a/src/timedate/timedatectl.c
b/src/timedate/timedatectl.c
index 2c24b78458b367da5c0318f88be2c04129d108e7..089a5fe3efbc21c22eecb2b56acb8e6b712cba56 100644
(file)
--- 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;
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;
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);
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);
" %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));
} else
printf(" DST active: %s\n", yes_no(is_dstc));