X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Foracle.c;h=1982aeefc65d948d4f4d59907989a20893f39c12;hb=50339a2982d56ec9faad833d9a5e589329be52f9;hp=c76bce2011c2a677a6eeaa17b49b122a29c45d84;hpb=b9b5e5d573d0011c4f3276e9b84b73ba4dd2e870;p=collectd.git diff --git a/src/oracle.c b/src/oracle.c index c76bce20..1982aeef 100644 --- a/src/oracle.c +++ b/src/oracle.c @@ -247,9 +247,7 @@ static int o_config_add_database(oconfig_item_t *ci) /* {{{ */ } /* while (status == 0) */ while ((status == 0) && (db->queries_num > 0)) { - db->q_prep_areas = (udb_query_preparation_area_t **)calloc( - db->queries_num, sizeof(*db->q_prep_areas)); - + db->q_prep_areas = calloc(db->queries_num, sizeof(*db->q_prep_areas)); if (db->q_prep_areas == NULL) { WARNING("oracle plugin: calloc failed"); status = -1; @@ -550,8 +548,7 @@ static int o_read_database_query(o_database_t *db, /* {{{ */ status = udb_query_prepare_result( q, prep_area, (db->host != NULL) ? db->host : hostname_g, /* plugin = */ (db->plugin_name != NULL) ? db->plugin_name : "oracle", - db->name, column_names, column_num, - /* interval = */ 0); + db->name, column_names, column_num); if (status != 0) { ERROR("oracle plugin: o_read_database_query (%s, %s): " "udb_query_prepare_result failed.", @@ -583,6 +580,8 @@ static int o_read_database_query(o_database_t *db, /* {{{ */ } } /* }}} while (42) */ + udb_query_finish_result(q, prep_area); + /* DEBUG ("oracle plugin: o_read_database_query: This statement succeeded: * %s", q->statement); */ FREE_ALL;