rc-status: initialize uptime pointer to prevent memory corruption

This fixes #231.
This commit is contained in:
Holger Hoffstätte 2018-06-28 23:08:57 +02:00 committed by William Hubbs
parent 02af762e83
commit 79648ac1c6

View File

@ -87,7 +87,7 @@ static char *get_uptime(const char *service)
time_t diff_hours = (time_t) 0;
time_t diff_mins = (time_t) 0;
time_t diff_secs = (time_t) 0;
char *uptime;
char *uptime = NULL;
if (state & RC_SERVICE_STARTED) {
start_count = rc_service_value_get(service, "start_count");