libcrypto refactoring: make more use of ASN1_STRING_set0()
[openssl.git] / crypto / asn1 / a_int.c
index 19e41ec73e3571dee06bd8e4447bd0f0ca1f7a6d..c3ab6a92221f64ed104f418834050c1fd4d7bac7 100644 (file)
@@ -444,9 +444,7 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,
         p += len;
     }
 
-    OPENSSL_free(ret->data);
-    ret->data = s;
-    ret->length = (int)len;
+    ASN1_STRING_set0(ret, s, (int)len);
     if (a != NULL)
         (*a) = ret;
     *pp = p;