From 94198e09d9771b3cedf7f26bbdecb991acb691c3 Mon Sep 17 00:00:00 2001 From: miod <> Date: Thu, 10 Jul 2014 21:57:20 +0000 Subject: Upon realloc() failure, free() the original pointer and remove the stupid comments implying you don't have to. ok tedu@ --- src/lib/libcrypto/x509v3/v3_pci.c | 6 +++--- src/lib/libssl/src/crypto/x509v3/v3_pci.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') 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 @@ -/* $OpenBSD: v3_pci.c,v 1.6 2014/07/10 13:58:23 jsing Exp $ */ +/* $OpenBSD: v3_pci.c,v 1.7 2014/07/10 21:57:20 miod Exp $ */ /* Contributed to the OpenSSL Project 2004 * by Richard Levitte (richard@levitte.org) */ @@ -141,7 +141,7 @@ process_pci_value(CONF_VALUE *val, ASN1_OBJECT **language, (*policy)->data[(*policy)->length] = '\0'; } else { free(tmp_data2); - /* realloc failure implies the original data space is b0rked too! */ + free((*policy)->data); (*policy)->data = NULL; (*policy)->length = 0; X509V3err(X509V3_F_PROCESS_PCI_VALUE, @@ -198,7 +198,7 @@ process_pci_value(CONF_VALUE *val, ASN1_OBJECT **language, (*policy)->length += val_len; (*policy)->data[(*policy)->length] = '\0'; } else { - /* realloc failure implies the original data space is b0rked too! */ + free((*policy)->data); (*policy)->data = NULL; (*policy)->length = 0; 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 @@ -/* $OpenBSD: v3_pci.c,v 1.6 2014/07/10 13:58:23 jsing Exp $ */ +/* $OpenBSD: v3_pci.c,v 1.7 2014/07/10 21:57:20 miod Exp $ */ /* Contributed to the OpenSSL Project 2004 * by Richard Levitte (richard@levitte.org) */ @@ -141,7 +141,7 @@ process_pci_value(CONF_VALUE *val, ASN1_OBJECT **language, (*policy)->data[(*policy)->length] = '\0'; } else { free(tmp_data2); - /* realloc failure implies the original data space is b0rked too! */ + free((*policy)->data); (*policy)->data = NULL; (*policy)->length = 0; X509V3err(X509V3_F_PROCESS_PCI_VALUE, @@ -198,7 +198,7 @@ process_pci_value(CONF_VALUE *val, ASN1_OBJECT **language, (*policy)->length += val_len; (*policy)->data[(*policy)->length] = '\0'; } else { - /* realloc failure implies the original data space is b0rked too! */ + free((*policy)->data); (*policy)->data = NULL; (*policy)->length = 0; X509V3err(X509V3_F_PROCESS_PCI_VALUE, -- cgit v1.2.3-55-g6feb