diff options
| author | deraadt <> | 2014-05-30 06:22:57 +0000 |
|---|---|---|
| committer | deraadt <> | 2014-05-30 06:22:57 +0000 |
| commit | abd9b10898e82011a65d8e8fca56bf56532edd69 (patch) | |
| tree | 1ff700d79cee9e764329e5c50d7eb8d5109789cc /src/lib/libcrypto/x509v3 | |
| parent | 2ff11427d41a52cb126e9892413db066f8ae166a (diff) | |
| download | openbsd-abd9b10898e82011a65d8e8fca56bf56532edd69.tar.gz openbsd-abd9b10898e82011a65d8e8fca56bf56532edd69.tar.bz2 openbsd-abd9b10898e82011a65d8e8fca56bf56532edd69.zip | |
more: no need for null check before free
ok tedu guenther
Diffstat (limited to 'src/lib/libcrypto/x509v3')
| -rw-r--r-- | src/lib/libcrypto/x509v3/v3_prn.c | 3 | ||||
| -rw-r--r-- | src/lib/libcrypto/x509v3/v3_utl.c | 18 |
2 files changed, 7 insertions, 14 deletions
diff --git a/src/lib/libcrypto/x509v3/v3_prn.c b/src/lib/libcrypto/x509v3/v3_prn.c index ff08534f9a..d06932aef1 100644 --- a/src/lib/libcrypto/x509v3/v3_prn.c +++ b/src/lib/libcrypto/x509v3/v3_prn.c | |||
| @@ -143,8 +143,7 @@ X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int indent) | |||
| 143 | 143 | ||
| 144 | err: | 144 | err: |
| 145 | sk_CONF_VALUE_pop_free(nval, X509V3_conf_free); | 145 | sk_CONF_VALUE_pop_free(nval, X509V3_conf_free); |
| 146 | if (value) | 146 | free(value); |
| 147 | free(value); | ||
| 148 | if (method->it) | 147 | if (method->it) |
| 149 | ASN1_item_free(ext_str, ASN1_ITEM_ptr(method->it)); | 148 | ASN1_item_free(ext_str, ASN1_ITEM_ptr(method->it)); |
| 150 | else | 149 | else |
diff --git a/src/lib/libcrypto/x509v3/v3_utl.c b/src/lib/libcrypto/x509v3/v3_utl.c index 0b389807dd..3134feff21 100644 --- a/src/lib/libcrypto/x509v3/v3_utl.c +++ b/src/lib/libcrypto/x509v3/v3_utl.c | |||
| @@ -103,12 +103,9 @@ X509V3_add_value(const char *name, const char *value, | |||
| 103 | 103 | ||
| 104 | err: | 104 | err: |
| 105 | X509V3err(X509V3_F_X509V3_ADD_VALUE, ERR_R_MALLOC_FAILURE); | 105 | X509V3err(X509V3_F_X509V3_ADD_VALUE, ERR_R_MALLOC_FAILURE); |
| 106 | if (vtmp) | 106 | free(vtmp); |
| 107 | free(vtmp); | 107 | free(tname); |
| 108 | if (tname) | 108 | free(tvalue); |
| 109 | free(tname); | ||
| 110 | if (tvalue) | ||
| 111 | free(tvalue); | ||
| 112 | return 0; | 109 | return 0; |
| 113 | } | 110 | } |
| 114 | 111 | ||
| @@ -126,12 +123,9 @@ X509V3_conf_free(CONF_VALUE *conf) | |||
| 126 | { | 123 | { |
| 127 | if (!conf) | 124 | if (!conf) |
| 128 | return; | 125 | return; |
| 129 | if (conf->name) | 126 | free(conf->name); |
| 130 | free(conf->name); | 127 | free(conf->value); |
| 131 | if (conf->value) | 128 | free(conf->section); |
| 132 | free(conf->value); | ||
| 133 | if (conf->section) | ||
| 134 | free(conf->section); | ||
| 135 | free(conf); | 129 | free(conf); |
| 136 | } | 130 | } |
| 137 | 131 | ||
