diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-02-18 19:22:07 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-02-18 19:22:07 +0100 |
commit | 233730e81a274dde5ca3f55af898dab7710ca899 (patch) | |
tree | 08a3d52ba46e82a891dfdd6b7bd25ddc3ff75d36 | |
parent | 1c4215259fdbb129a1e3f2f2d8c6a65313dd2151 (diff) | |
download | gnutls-233730e81a274dde5ca3f55af898dab7710ca899.tar.gz |
Use gnutls_realloc_fast everywhere. Suggested by David Woodhouse.
-rw-r--r-- | lib/ext/session_ticket.c | 2 | ||||
-rw-r--r-- | lib/gnutls_datum.c | 2 | ||||
-rw-r--r-- | lib/gnutls_extensions.c | 2 | ||||
-rw-r--r-- | lib/gnutls_str.c | 4 | ||||
-rw-r--r-- | lib/gnutls_x509.c | 2 | ||||
-rw-r--r-- | lib/x509/ocsp.c | 2 | ||||
-rw-r--r-- | lib/x509/pkcs12.c | 4 | ||||
-rw-r--r-- | lib/xssl_getline.c | 4 |
8 files changed, 11 insertions, 11 deletions
diff --git a/lib/ext/session_ticket.c b/lib/ext/session_ticket.c index 9af576917a..0bb222c4eb 100644 --- a/lib/ext/session_ticket.c +++ b/lib/ext/session_ticket.c @@ -707,7 +707,7 @@ _gnutls_recv_new_session_ticket (gnutls_session_t session) p += 2; DECR_LENGTH_COM (data_size, ticket_len, ret = GNUTLS_E_UNEXPECTED_PACKET_LENGTH; goto error); - priv->session_ticket = gnutls_realloc (priv->session_ticket, ticket_len); + priv->session_ticket = gnutls_realloc_fast (priv->session_ticket, ticket_len); if (!priv->session_ticket) { gnutls_assert (); diff --git a/lib/gnutls_datum.c b/lib/gnutls_datum.c index c1b03e3698..89b280a854 100644 --- a/lib/gnutls_datum.c +++ b/lib/gnutls_datum.c @@ -56,7 +56,7 @@ _gnutls_datum_append (gnutls_datum_t * dst, const void *data, size_t data_size) { - dst->data = gnutls_realloc (dst->data, data_size + dst->size); + dst->data = gnutls_realloc_fast (dst->data, data_size + dst->size); if (dst->data == NULL) return GNUTLS_E_MEMORY_ERROR; diff --git a/lib/gnutls_extensions.c b/lib/gnutls_extensions.c index 90a4936a8d..f676993ece 100644 --- a/lib/gnutls_extensions.c +++ b/lib/gnutls_extensions.c @@ -384,7 +384,7 @@ _gnutls_ext_register (extension_entry_st * mod) { extension_entry_st *p; - p = gnutls_realloc (extfunc, sizeof (*extfunc) * (extfunc_size + 1)); + p = gnutls_realloc_fast (extfunc, sizeof (*extfunc) * (extfunc_size + 1)); if (!p) { gnutls_assert (); diff --git a/lib/gnutls_str.c b/lib/gnutls_str.c index 7ef5a246b6..5756ce3951 100644 --- a/lib/gnutls_str.c +++ b/lib/gnutls_str.c @@ -149,7 +149,7 @@ _gnutls_buffer_append_data (gnutls_buffer_st * dest, const void *data, size_t new_len = MAX (data_size, MIN_CHUNK) + MAX (dest->max_length, MIN_CHUNK); - dest->allocd = gnutls_realloc (dest->allocd, new_len); + dest->allocd = gnutls_realloc_fast (dest->allocd, new_len); if (dest->allocd == NULL) { gnutls_assert (); @@ -190,7 +190,7 @@ _gnutls_buffer_resize (gnutls_buffer_st * dest, size_t new_size) size_t alloc_len = MAX (new_size, MIN_CHUNK) + MAX (dest->max_length, MIN_CHUNK); - dest->allocd = gnutls_realloc (dest->allocd, alloc_len); + dest->allocd = gnutls_realloc_fast (dest->allocd, alloc_len); if (dest->allocd == NULL) { gnutls_assert (); diff --git a/lib/gnutls_x509.c b/lib/gnutls_x509.c index bba68f5dd3..c7573878cc 100644 --- a/lib/gnutls_x509.c +++ b/lib/gnutls_x509.c @@ -1359,7 +1359,7 @@ add_new_crt_to_rdn_seq (gnutls_certificate_credentials_t res, gnutls_x509_crt_t* return GNUTLS_E_SHORT_MEMORY_BUFFER; } - newdata = gnutls_realloc (res->x509_rdn_sequence.data, newsize); + newdata = gnutls_realloc_fast (res->x509_rdn_sequence.data, newsize); if (newdata == NULL) { gnutls_assert (); diff --git a/lib/x509/ocsp.c b/lib/x509/ocsp.c index 0de0b4fd23..7dd0f85619 100644 --- a/lib/x509/ocsp.c +++ b/lib/x509/ocsp.c @@ -1834,7 +1834,7 @@ gnutls_ocsp_resp_get_certs (gnutls_ocsp_resp_t resp, goto error; } - tmpcerts2 = gnutls_realloc (tmpcerts, (ctr + 2) * sizeof (*tmpcerts)); + tmpcerts2 = gnutls_realloc_fast (tmpcerts, (ctr + 2) * sizeof (*tmpcerts)); if (tmpcerts2 == NULL) { gnutls_assert (); diff --git a/lib/x509/pkcs12.c b/lib/x509/pkcs12.c index 5ebf53477c..1d12947b16 100644 --- a/lib/x509/pkcs12.c +++ b/lib/x509/pkcs12.c @@ -1359,7 +1359,7 @@ unsigned int i; gnutls_x509_crt_check_issuer((*extra_certs)[i], (*extra_certs)[i]) != 0) goto skip; - *chain = gnutls_realloc (*chain, sizeof((*chain)[0]) * + *chain = gnutls_realloc_fast (*chain, sizeof((*chain)[0]) * ++(*chain_len)); if (*chain == NULL) { @@ -1700,7 +1700,7 @@ gnutls_pkcs12_simple_parse (gnutls_pkcs12_t p12, { /* they don't match - skip the certificate */ if (extra_certs) { - _extra_certs = gnutls_realloc (_extra_certs, + _extra_certs = gnutls_realloc_fast (_extra_certs, sizeof(_extra_certs[0]) * ++_extra_certs_len); if (!_extra_certs) diff --git a/lib/xssl_getline.c b/lib/xssl_getline.c index 4f571b8bef..0a9f19605c 100644 --- a/lib/xssl_getline.c +++ b/lib/xssl_getline.c @@ -63,7 +63,7 @@ xssl_getdelim (xssl_t sbuf, char **lineptr, size_t *n, int delimiter) { char *new_lineptr; *n = 120; - new_lineptr = (char *) gnutls_realloc (*lineptr, *n); + new_lineptr = (char *) gnutls_realloc_fast (*lineptr, *n); if (new_lineptr == NULL) { result = gnutls_assert_val(GNUTLS_E_MEMORY_ERROR); @@ -99,7 +99,7 @@ xssl_getdelim (xssl_t sbuf, char **lineptr, size_t *n, int delimiter) goto fail; } - new_lineptr = (char *) gnutls_realloc (*lineptr, needed); + new_lineptr = (char *) gnutls_realloc_fast (*lineptr, needed); if (new_lineptr == NULL) { result = gnutls_assert_val(GNUTLS_E_MEMORY_ERROR); |