Merge from the ASN1 branch of new ASN1 code
[openssl.git] / apps / req.c
index 4c4b9e3eac7464046d512093dde610165918c8a8..7b8b4dbd60bc956ef848a183ca406542c300a07b 100644 (file)
@@ -752,8 +752,11 @@ loop:
                                }
 
                        i=make_REQ(req,pkey,!x509);
-                       if (kludge >= 0)
-                               req->req_info->req_kludge=kludge;
+                       if ((kludge > 0) && !sk_X509_ATTRIBUTE_num(req->req_info->attributes))
+                               {
+                               sk_X509_ATTRIBUTE_free(req->req_info->attributes);
+                               req->req_info->attributes = NULL;
+                               }
                        if (!i)
                                {
                                BIO_printf(bio_err,"problems making Certificate Request\n");