From 3987dcfe61f3c9b7311df69ea0b1d73613e94b9b Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Tue, 9 May 2006 16:13:32 +0000 Subject: some fixes. node_asn now has value_len set to zero on initialization. --- lib/errors.c | 2 +- lib/parser_aux.c | 7 +------ lib/structure.c | 7 +------ 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/lib/errors.c b/lib/errors.c index f1e0d5f..0d3e4a2 100644 --- a/lib/errors.c +++ b/lib/errors.c @@ -83,7 +83,7 @@ libtasn1_perror (asn1_retCode error) /* avoid prefix */ LIBTASN1_ERROR_ALG_LOOP (ret = p->name + sizeof ("ASN1_") - 1); - _libtasn1_log ("LIBTASN1 ERROR: %s\n", ret); + fprintf (stderr, "LIBTASN1 ERROR: %s\n", ret); } diff --git a/lib/parser_aux.c b/lib/parser_aux.c index 16c28ec..fbb6a80 100644 --- a/lib/parser_aux.c +++ b/lib/parser_aux.c @@ -59,7 +59,7 @@ _asn1_add_node (unsigned int type) list_type *listElement; node_asn *punt; - punt = (node_asn *) _asn1_malloc (sizeof (node_asn)); + punt = (node_asn *) _asn1_calloc (1, sizeof (node_asn)); if (punt == NULL) return NULL; @@ -74,12 +74,7 @@ _asn1_add_node (unsigned int type) listElement->next = firstElement; firstElement = listElement; - punt->left = NULL; - punt->name = NULL; punt->type = type; - punt->value = NULL; - punt->down = NULL; - punt->right = NULL; return punt; } diff --git a/lib/structure.c b/lib/structure.c index 70bc172..4b2ee50 100644 --- a/lib/structure.c +++ b/lib/structure.c @@ -51,16 +51,11 @@ _asn1_add_node_only (unsigned int type) { node_asn *punt; - punt = (node_asn *) _asn1_malloc (sizeof (node_asn)); + punt = (node_asn *) _asn1_calloc (1, sizeof (node_asn)); if (punt == NULL) return NULL; - punt->left = NULL; - punt->name = NULL; punt->type = type; - punt->value = NULL; - punt->down = NULL; - punt->right = NULL; return punt; } -- cgit v1.2.3