diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2014-05-10 13:53:01 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2014-05-10 13:53:01 +0200 |
commit | 94c8a2d9f018c22116f5c3fef8b81504a1ab471b (patch) | |
tree | ea34bf0f6574da466934caae50ef64671c86ac36 /lib/parser_aux.c | |
parent | 1a1a7a8a27b15e31a408b8cb787e4045eaa57f87 (diff) | |
download | libtasn1-94c8a2d9f018c22116f5c3fef8b81504a1ab471b.tar.gz libtasn1-94c8a2d9f018c22116f5c3fef8b81504a1ab471b.tar.bz2 libtasn1-94c8a2d9f018c22116f5c3fef8b81504a1ab471b.zip |
cleaned up a bit _asn1_remove_node().
Diffstat (limited to 'lib/parser_aux.c')
-rw-r--r-- | lib/parser_aux.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/parser_aux.c b/lib/parser_aux.c index 6b34512..31d1770 100644 --- a/lib/parser_aux.c +++ b/lib/parser_aux.c @@ -458,12 +458,16 @@ _asn1_remove_node (asn1_node node, unsigned int flags) if (node == NULL) return; - if (flags & ASN1_DELETE_FLAG_ZEROIZE && node->value) { - safe_memset(node->value, 0, node->value_len); - } + if (node->value != NULL) + { + if (flags & ASN1_DELETE_FLAG_ZEROIZE) + { + safe_memset(node->value, 0, node->value_len); + } - if (node->value != NULL && node->value != node->small_value) - free (node->value); + if (node->value != node->small_value) + free (node->value); + } free (node); } |