diff --git a/srtp/srtp.c b/srtp/srtp.c index 0b91add04..291dcbb94 100644 --- a/srtp/srtp.c +++ b/srtp/srtp.c @@ -4906,10 +4906,10 @@ srtp_err_status_t srtp_stream_list_insert(srtp_stream_list_t list, { /* * there is no space to hold the new entry in the entries buffer, - * double the size of the buffer. + * increase the size of the buffer by a factor of 1.5. */ if (list->size == list->capacity) { - size_t new_capacity = list->capacity * 2; + size_t new_capacity = list->capacity + ((list->capacity + 1u) / 2u); list_entry *new_entries = srtp_crypto_alloc(sizeof(list_entry) * new_capacity); if (new_entries == NULL) {