summaryrefslogtreecommitdiff
path: root/lib/minitasn1
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2008-08-29 13:12:04 +0200
committerSimon Josefsson <simon@josefsson.org>2008-08-29 13:12:04 +0200
commit2c9f3052d26e558f7610a75ff9013ff6f4b9bd63 (patch)
treebc260d2780d19ed39f117283ffbd0cf97c3d66ef /lib/minitasn1
parent74e999385ba80a775af4662e66eceabec8f0f113 (diff)
downloadgnutls-2c9f3052d26e558f7610a75ff9013ff6f4b9bd63.tar.gz
Use libtasn1 1.5.
Diffstat (limited to 'lib/minitasn1')
-rw-r--r--lib/minitasn1/element.c25
-rw-r--r--lib/minitasn1/libtasn1.h2
-rw-r--r--lib/minitasn1/structure.c2
3 files changed, 22 insertions, 7 deletions
diff --git a/lib/minitasn1/element.c b/lib/minitasn1/element.c
index 752b40da85..703276c809 100644
--- a/lib/minitasn1/element.c
+++ b/lib/minitasn1/element.c
@@ -420,7 +420,10 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
asn1_length_der (len - k, NULL, &len2);
temp = (unsigned char *) _asn1_malloc (len - k + len2);
if (temp == NULL)
- return ASN1_MEM_ALLOC_ERROR;
+ {
+ _asn1_free (value_temp);
+ return ASN1_MEM_ALLOC_ERROR;
+ }
asn1_octet_der (value_temp + k, len - k, temp, &len2);
_asn1_set_value (node, temp, len2);
@@ -438,7 +441,10 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
default_temp =
(unsigned char *) _asn1_malloc (SIZEOF_UNSIGNED_LONG_INT);
if (default_temp == NULL)
- return ASN1_MEM_ALLOC_ERROR;
+ {
+ _asn1_free (value_temp);
+ return ASN1_MEM_ALLOC_ERROR;
+ }
_asn1_convert_integer (p->value, default_temp,
SIZEOF_UNSIGNED_LONG_INT, &len2);
@@ -446,7 +452,10 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
else
{ /* is an identifier like v1 */
if (!(node->type & CONST_LIST))
- return ASN1_VALUE_NOT_VALID;
+ {
+ _asn1_free (value_temp);
+ return ASN1_VALUE_NOT_VALID;
+ }
p2 = node->down;
while (p2)
{
@@ -458,7 +467,10 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
(unsigned char *)
_asn1_malloc (SIZEOF_UNSIGNED_LONG_INT);
if (default_temp == NULL)
- return ASN1_MEM_ALLOC_ERROR;
+ {
+ _asn1_free (value_temp);
+ return ASN1_MEM_ALLOC_ERROR;
+ }
_asn1_convert_integer (p2->value,
default_temp,
@@ -470,7 +482,10 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
p2 = p2->right;
}
if (p2 == NULL)
- return ASN1_VALUE_NOT_VALID;
+ {
+ _asn1_free (value_temp);
+ return ASN1_VALUE_NOT_VALID;
+ }
}
diff --git a/lib/minitasn1/libtasn1.h b/lib/minitasn1/libtasn1.h
index fd35867367..d7d4f70a7c 100644
--- a/lib/minitasn1/libtasn1.h
+++ b/lib/minitasn1/libtasn1.h
@@ -31,7 +31,7 @@ extern "C"
{
#endif
-#define LIBTASN1_VERSION "1.4"
+#define LIBTASN1_VERSION "1.5"
#include <sys/types.h>
#include <time.h>
diff --git a/lib/minitasn1/structure.c b/lib/minitasn1/structure.c
index a7a4c623b9..743e9ba42a 100644
--- a/lib/minitasn1/structure.c
+++ b/lib/minitasn1/structure.c
@@ -409,7 +409,7 @@ _asn1_copy_structure3 (node_asn * source_node)
if (p_s->name)
_asn1_set_name (p_d, p_s->name);
if (p_s->value)
- _asn1_set_value (p_d, p_s->value, p_s->value_len);
+ _asn1_set_value (p_d, p_s->value, p_s->value_len);
move = DOWN;
}
else