From 79648ac1c6355975abca6acf6076e7022037523f Mon Sep 17 00:00:00 2001 From: Holger Hoffstätte Date: Thu, 28 Jun 2018 23:08:57 +0200 Subject: rc-status: initialize uptime pointer to prevent memory corruption This fixes #231. --- src/rc/rc-status.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rc/rc-status.c b/src/rc/rc-status.c index 85e71dbb..cebdc5ed 100644 --- a/src/rc/rc-status.c +++ b/src/rc/rc-status.c @@ -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"); -- cgit v1.2.3