--- x_attrib.c.orig     2016-03-06 17:35:12.565385098 -0800
+++ x_attrib.c  2016-03-06 17:37:35.383536550 -0800
@@ -105,6 +105,8 @@
     if ((ret = X509_ATTRIBUTE_new()) == NULL)
         return (NULL);
     ret->object = OBJ_nid2obj(nid);
+    if (ret->object == NULL)
+       goto err;
     ret->single = 0;
     if ((ret->value.set = sk_ASN1_TYPE_new_null()) == NULL)
         goto err;
		 