X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Fpostgresql.c;h=3b125ee8bd5149a2d7b7c9720c4dd8501ce5030a;hb=4103105fb43cd72294f165b2541540b3a8a99532;hp=759560e874dea71be320627da02d2bf7613e7946;hpb=aef15b632b9f415e5ebfadd4e41fa8a3c19407ee;p=collectd.git diff --git a/src/postgresql.c b/src/postgresql.c index 759560e8..3b125ee8 100644 --- a/src/postgresql.c +++ b/src/postgresql.c @@ -31,6 +31,7 @@ */ #include "collectd.h" + #include "common.h" #include "configfile.h" @@ -40,10 +41,6 @@ #include "utils_db_query.h" #include "utils_complain.h" -#if HAVE_PTHREAD_H -# include -#endif - #include #include @@ -1192,7 +1189,7 @@ static int c_psql_config_database (oconfig_item_t *ci) c_psql_database_t *db; char cb_name[DATA_MAX_NAME_LEN]; - user_data_t ud; + user_data_t ud = { 0 }; static _Bool have_flush = 0; @@ -1204,8 +1201,6 @@ static int c_psql_config_database (oconfig_item_t *ci) return 1; } - memset (&ud, 0, sizeof (ud)); - db = c_psql_database_new (ci->values[0].value.string); if (db == NULL) return -1;