aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/https/minitasn1/element.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/https/minitasn1/element.c')
-rw-r--r--src/daemon/https/minitasn1/element.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/daemon/https/minitasn1/element.c b/src/daemon/https/minitasn1/element.c
index 25b4975a..5bfb1ed0 100644
--- a/src/daemon/https/minitasn1/element.c
+++ b/src/daemon/https/minitasn1/element.c
@@ -420,7 +420,10 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
420 asn1_length_der (len - k, NULL, &len2); 420 asn1_length_der (len - k, NULL, &len2);
421 temp = (unsigned char *) _asn1_alloca (len - k + len2); 421 temp = (unsigned char *) _asn1_alloca (len - k + len2);
422 if (temp == NULL) 422 if (temp == NULL)
423 return ASN1_MEM_ALLOC_ERROR; 423 {
424 _asn1_afree (value_temp);
425 return ASN1_MEM_ALLOC_ERROR;
426 }
424 427
425 asn1_octet_der (value_temp + k, len - k, temp, &len2); 428 asn1_octet_der (value_temp + k, len - k, temp, &len2);
426 _asn1_set_value (node, temp, len2); 429 _asn1_set_value (node, temp, len2);
@@ -438,7 +441,10 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
438 default_temp = 441 default_temp =
439 (unsigned char *) _asn1_alloca (SIZEOF_UNSIGNED_LONG_INT); 442 (unsigned char *) _asn1_alloca (SIZEOF_UNSIGNED_LONG_INT);
440 if (default_temp == NULL) 443 if (default_temp == NULL)
441 return ASN1_MEM_ALLOC_ERROR; 444 {
445 _asn1_afree (value_temp);
446 return ASN1_MEM_ALLOC_ERROR;
447 }
442 448
443 _asn1_convert_integer (p->value, default_temp, 449 _asn1_convert_integer (p->value, default_temp,
444 SIZEOF_UNSIGNED_LONG_INT, &len2); 450 SIZEOF_UNSIGNED_LONG_INT, &len2);
@@ -446,7 +452,10 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
446 else 452 else
447 { /* is an identifier like v1 */ 453 { /* is an identifier like v1 */
448 if (!(node->type & CONST_LIST)) 454 if (!(node->type & CONST_LIST))
449 return ASN1_VALUE_NOT_VALID; 455 {
456 _asn1_afree (value_temp);
457 return ASN1_VALUE_NOT_VALID;
458 }
450 p2 = node->down; 459 p2 = node->down;
451 while (p2) 460 while (p2)
452 { 461 {
@@ -458,7 +467,10 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
458 (unsigned char *) 467 (unsigned char *)
459 _asn1_alloca (SIZEOF_UNSIGNED_LONG_INT); 468 _asn1_alloca (SIZEOF_UNSIGNED_LONG_INT);
460 if (default_temp == NULL) 469 if (default_temp == NULL)
461 return ASN1_MEM_ALLOC_ERROR; 470 {
471 _asn1_afree (value_temp);
472 return ASN1_MEM_ALLOC_ERROR;
473 }
462 474
463 _asn1_convert_integer (p2->value, 475 _asn1_convert_integer (p2->value,
464 default_temp, 476 default_temp,
@@ -470,7 +482,10 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
470 p2 = p2->right; 482 p2 = p2->right;
471 } 483 }
472 if (p2 == NULL) 484 if (p2 == NULL)
473 return ASN1_VALUE_NOT_VALID; 485 {
486 _asn1_afree (value_temp);
487 return ASN1_VALUE_NOT_VALID;
488 }
474 } 489 }
475 490
476 491