summaryrefslogtreecommitdiff
path: root/libdane
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2014-07-22 18:14:50 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2014-07-22 18:14:50 +0200
commit330b569999a1eef94decea56e06fc45d936bf14e (patch)
tree13d7d4f4154a247853f932e0549e5e598837630e /libdane
parentbbfe80538a09b336684bc1c348cc5ea83a189400 (diff)
downloadgnutls-330b569999a1eef94decea56e06fc45d936bf14e.tar.gz
libdane: use gnutls_malloc() and doc update
Diffstat (limited to 'libdane')
-rw-r--r--libdane/dane.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libdane/dane.c b/libdane/dane.c
index 8c1f3b0c47..29721697e4 100644
--- a/libdane/dane.c
+++ b/libdane/dane.c
@@ -147,10 +147,10 @@ dane_query_data(dane_query_t q, unsigned int idx,
* This function will provide the DANE data from the query
* response.
*
- * The pointers dane_data and dane_data_len are allocated with malloc()
+ * The pointers dane_data and dane_data_len are allocated with gnutls_malloc()
* to contain a copy of the data from the query result structure (individual
- * rdata items are not allocated separately). The query result structure can
- * be safely deinitialized after calling this function.
+ * rdata items are not allocated separately). The returned data are only valid
+ * during the lifetime of @q.
*
* Returns: On success, %DANE_E_SUCCESS (0) is returned, otherwise a
* negative error value.
@@ -185,13 +185,13 @@ dane_query_to_raw_tlsa(dane_query_t q, unsigned int *data_entries,
for (idx = 0; idx < q->data_entries; idx++)
data_sz += 3 + q->data[idx].size;
- *dane_data = calloc (1, data_sz);
+ *dane_data = gnutls_calloc (1, data_sz);
if (*dane_data == NULL)
return DANE_E_MEMORY_ERROR;
data_buf = (char *)*dane_data;
data_buf += sizeof (**dane_data) * (q->data_entries + 1);
- *dane_data_len = calloc (q->data_entries + 1, sizeof (**dane_data_len));
+ *dane_data_len = gnutls_calloc (q->data_entries + 1, sizeof (**dane_data_len));
if (*dane_data_len == NULL) {
free(*dane_data);
*dane_data = NULL;