From: Sebastian Harl Date: Wed, 29 Jan 2014 20:42:09 +0000 (+0100) Subject: utils dbi: Use sdb_data_free_datum(). X-Git-Tag: sysdb-0.1.0~230 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9ee6c7fc9932e3fcb6d8aebe5364b1da3116af05;p=sysdb.git utils dbi: Use sdb_data_free_datum(). --- diff --git a/src/utils/dbi.c b/src/utils/dbi.c index c8eb816..a30f548 100644 --- a/src/utils/dbi.c +++ b/src/utils/dbi.c @@ -155,13 +155,8 @@ sdb_dbi_get_data(sdb_dbi_client_t *client, dbi_result res, continue; status = callback(client, num_fields, data, user_data); - for (i = 0; i < num_fields; ++i) { - if ((data[i].type == SDB_TYPE_STRING) && (data[i].data.string)) - free(data[i].data.string); - else if ((data[i].type == SDB_TYPE_BINARY) - && (data[i].data.binary.datum)) - free(data[i].data.binary.datum); - } + for (i = 0; i < num_fields; ++i) + sdb_data_free_datum(&data[i]); if (status) continue;