X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fmysql.c;h=54236dac188c0aa585a9ecf946e7d3775006afdb;hb=58c91485b9b28a866715fc013d23236470699940;hp=9b8d6cf3aba8c97117f50e7c934fd008f44b8b33;hpb=e0a35d57e56ec31e42b1aa984cb2038f570925e6;p=collectd.git diff --git a/src/mysql.c b/src/mysql.c index 9b8d6cf3..54236dac 100644 --- a/src/mysql.c +++ b/src/mysql.c @@ -28,6 +28,7 @@ **/ #include "collectd.h" + #include "common.h" #include "plugin.h" #include "configfile.h" @@ -71,7 +72,7 @@ static void mysql_database_free (void *arg) /* {{{ */ DEBUG ("mysql plugin: mysql_database_free (arg = %p);", arg); - db = (mysql_database_t *) arg; + db = arg; if (db == NULL) return; @@ -191,13 +192,12 @@ static int mysql_config_database (oconfig_item_t *ci) /* {{{ */ /* If all went well, register this database for reading */ if (status == 0) { - user_data_t ud; + user_data_t ud = { 0 }; char cb_name[DATA_MAX_NAME_LEN]; DEBUG ("mysql plugin: Registering new read callback: %s", (db->database != NULL) ? db->database : ""); - memset (&ud, 0, sizeof (ud)); ud.data = (void *) db; ud.free_func = mysql_database_free;