Fix some missing OBJ_dup failure checks.

More malloc failure stuff.

Change-Id: I9c34941cbf43919b501a4a737ff150e4e2606949
Reviewed-on: https://boringssl-review.googlesource.com/4519
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/x509/x509_att.c b/crypto/x509/x509_att.c
index 3613c35..90e7810 100644
--- a/crypto/x509/x509_att.c
+++ b/crypto/x509/x509_att.c
@@ -273,7 +273,7 @@
 		return(0);
 	ASN1_OBJECT_free(attr->object);
 	attr->object=OBJ_dup(obj);
-	return(1);
+	return attr->object != NULL;
 }
 
 int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, int len)
diff --git a/crypto/x509/x509_v3.c b/crypto/x509/x509_v3.c
index 95fe729..0fc9a9a 100644
--- a/crypto/x509/x509_v3.c
+++ b/crypto/x509/x509_v3.c
@@ -231,7 +231,7 @@
 		return(0);
 	ASN1_OBJECT_free(ex->object);
 	ex->object=OBJ_dup(obj);
-	return(1);
+	return ex->object != NULL;
 	}
 
 int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit)