]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - crypto/x509/x_x509.c
X509: add more error codes on malloc or sk_TYP_push failure
[thirdparty/openssl.git] / crypto / x509 / x_x509.c
index c28fdda77a0ade7b802d354142bfe4d9ad6eb4d5..cf71180ea81d663317bb80a052ba4c9dd0a52d01 100644 (file)
@@ -189,8 +189,10 @@ int i2d_X509_AUX(X509 *a, unsigned char **pp)
 
     /* Allocate requisite combined storage */
     *pp = tmp = OPENSSL_malloc(length);
-    if (tmp == NULL)
-        return -1; /* Push error onto error stack? */
+    if (tmp == NULL) {
+        X509err(X509_F_I2D_X509_AUX, ERR_R_MALLOC_FAILURE);
+        return -1;
+    }
 
     /* Encode, but keep *pp at the originally malloced pointer */
     length = i2d_x509_aux_internal(a, &tmp);