summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormiod <>2014-07-10 21:57:20 +0000
committermiod <>2014-07-10 21:57:20 +0000
commit94198e09d9771b3cedf7f26bbdecb991acb691c3 (patch)
tree23b9f9bafc047eae88f748dfe8ecd51b3839b528 /src
parentfeb74bdc75aa807a2ee5e7258869eb945d43d060 (diff)
downloadopenbsd-94198e09d9771b3cedf7f26bbdecb991acb691c3.tar.gz
openbsd-94198e09d9771b3cedf7f26bbdecb991acb691c3.tar.bz2
openbsd-94198e09d9771b3cedf7f26bbdecb991acb691c3.zip
Upon realloc() failure, free() the original pointer and remove the stupid
comments implying you don't have to. ok tedu@
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/x509v3/v3_pci.c6
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_pci.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libcrypto/x509v3/v3_pci.c b/src/lib/libcrypto/x509v3/v3_pci.c
index 34a34a6fcc..56b955c9c3 100644
--- a/src/lib/libcrypto/x509v3/v3_pci.c
+++ b/src/lib/libcrypto/x509v3/v3_pci.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_pci.c,v 1.6 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_pci.c,v 1.7 2014/07/10 21:57:20 miod Exp $ */
2/* Contributed to the OpenSSL Project 2004 2/* Contributed to the OpenSSL Project 2004
3 * by Richard Levitte (richard@levitte.org) 3 * by Richard Levitte (richard@levitte.org)
4 */ 4 */
@@ -141,7 +141,7 @@ process_pci_value(CONF_VALUE *val, ASN1_OBJECT **language,
141 (*policy)->data[(*policy)->length] = '\0'; 141 (*policy)->data[(*policy)->length] = '\0';
142 } else { 142 } else {
143 free(tmp_data2); 143 free(tmp_data2);
144 /* realloc failure implies the original data space is b0rked too! */ 144 free((*policy)->data);
145 (*policy)->data = NULL; 145 (*policy)->data = NULL;
146 (*policy)->length = 0; 146 (*policy)->length = 0;
147 X509V3err(X509V3_F_PROCESS_PCI_VALUE, 147 X509V3err(X509V3_F_PROCESS_PCI_VALUE,
@@ -198,7 +198,7 @@ process_pci_value(CONF_VALUE *val, ASN1_OBJECT **language,
198 (*policy)->length += val_len; 198 (*policy)->length += val_len;
199 (*policy)->data[(*policy)->length] = '\0'; 199 (*policy)->data[(*policy)->length] = '\0';
200 } else { 200 } else {
201 /* realloc failure implies the original data space is b0rked too! */ 201 free((*policy)->data);
202 (*policy)->data = NULL; 202 (*policy)->data = NULL;
203 (*policy)->length = 0; 203 (*policy)->length = 0;
204 X509V3err(X509V3_F_PROCESS_PCI_VALUE, 204 X509V3err(X509V3_F_PROCESS_PCI_VALUE,
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_pci.c b/src/lib/libssl/src/crypto/x509v3/v3_pci.c
index 34a34a6fcc..56b955c9c3 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_pci.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_pci.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_pci.c,v 1.6 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_pci.c,v 1.7 2014/07/10 21:57:20 miod Exp $ */
2/* Contributed to the OpenSSL Project 2004 2/* Contributed to the OpenSSL Project 2004
3 * by Richard Levitte (richard@levitte.org) 3 * by Richard Levitte (richard@levitte.org)
4 */ 4 */
@@ -141,7 +141,7 @@ process_pci_value(CONF_VALUE *val, ASN1_OBJECT **language,
141 (*policy)->data[(*policy)->length] = '\0'; 141 (*policy)->data[(*policy)->length] = '\0';
142 } else { 142 } else {
143 free(tmp_data2); 143 free(tmp_data2);
144 /* realloc failure implies the original data space is b0rked too! */ 144 free((*policy)->data);
145 (*policy)->data = NULL; 145 (*policy)->data = NULL;
146 (*policy)->length = 0; 146 (*policy)->length = 0;
147 X509V3err(X509V3_F_PROCESS_PCI_VALUE, 147 X509V3err(X509V3_F_PROCESS_PCI_VALUE,
@@ -198,7 +198,7 @@ process_pci_value(CONF_VALUE *val, ASN1_OBJECT **language,
198 (*policy)->length += val_len; 198 (*policy)->length += val_len;
199 (*policy)->data[(*policy)->length] = '\0'; 199 (*policy)->data[(*policy)->length] = '\0';
200 } else { 200 } else {
201 /* realloc failure implies the original data space is b0rked too! */ 201 free((*policy)->data);
202 (*policy)->data = NULL; 202 (*policy)->data = NULL;
203 (*policy)->length = 0; 203 (*policy)->length = 0;
204 X509V3err(X509V3_F_PROCESS_PCI_VALUE, 204 X509V3err(X509V3_F_PROCESS_PCI_VALUE,