Code

write_sensu: initialize ret_str
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 2 Apr 2016 14:53:16 +0000 (16:53 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 2 Apr 2016 14:53:16 +0000 (16:53 +0200)
Else we might free an uninitialized ptr
CID #81392

src/write_sensu.c

index c427467c5b2d8059d51be502f953229817e79099..475354c83bb0110c89b81dde3e85cb33a3203953 100644 (file)
@@ -177,7 +177,7 @@ static void sensu_close_socket(struct sensu_host *host) /* {{{ */
 static char *build_json_str_list(const char *tag, struct str_list const *list) /* {{{ */
 {
        int res;
-       char *ret_str;
+       char *ret_str = NULL;
        char *temp_str;
        int i;
        if (list->nb_strs == 0) {