summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2004-10-24 14:22:29 +0000
committerSimon Josefsson <simon@josefsson.org>2004-10-24 14:22:29 +0000
commiteef91967446429fb84b0c0663d4647bf8a31c471 (patch)
tree1a37efb2236b47377ec09aab42ab02205155b384 /lib
parent3853c22ec5e9f47fd61f764deceec464abe9e94d (diff)
downloadgnutls-eef91967446429fb84b0c0663d4647bf8a31c471.tar.gz
(gnutls_certificate_set_x509_trust): Fix memory bug, tiny patch by
Aleix Conchillo Flaque <aleix@member.fsf.org>.
Diffstat (limited to 'lib')
-rw-r--r--lib/gnutls_x509.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/gnutls_x509.c b/lib/gnutls_x509.c
index f5d59e2958..5fa0e5e2dc 100644
--- a/lib/gnutls_x509.c
+++ b/lib/gnutls_x509.c
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2002,2003 Nikos Mavroyanopoulos
* Copyright (C) 2004 Free Software Foundation
+ * Copyright (C) 2002,2003 Nikos Mavroyanopoulos
*
* This file is part of GNUTLS.
*
@@ -1321,7 +1321,8 @@ int gnutls_certificate_set_x509_trust(gnutls_certificate_credentials_t res,
}
for (i = 0; i < ca_list_size; i++) {
- ret = _gnutls_x509_crt_cpy(res->x509_ca_list[i + res->x509_ncas],
+ gnutls_x509_crt_init(&res->x509_ca_list[i + res->x509_ncas]);
+ ret = _gnutls_x509_crt_cpy(res->x509_ca_list[i + res->x509_ncas],
ca_list[i]);
if (ret < 0) {
gnutls_assert();