rc-status: initialize uptime pointer to prevent memory corruption
This fixes #231.
This commit is contained in:
parent
02af762e83
commit
79648ac1c6
@ -87,7 +87,7 @@ static char *get_uptime(const char *service)
|
|||||||
time_t diff_hours = (time_t) 0;
|
time_t diff_hours = (time_t) 0;
|
||||||
time_t diff_mins = (time_t) 0;
|
time_t diff_mins = (time_t) 0;
|
||||||
time_t diff_secs = (time_t) 0;
|
time_t diff_secs = (time_t) 0;
|
||||||
char *uptime;
|
char *uptime = NULL;
|
||||||
|
|
||||||
if (state & RC_SERVICE_STARTED) {
|
if (state & RC_SERVICE_STARTED) {
|
||||||
start_count = rc_service_value_get(service, "start_count");
|
start_count = rc_service_value_get(service, "start_count");
|
||||||
|
Loading…
Reference in New Issue
Block a user