Skip to content

Commit 2877b7b

Browse files
author
Andras Fekete
committed
Fix possible memory leak
1 parent 21d465c commit 2877b7b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/x509.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14098,7 +14098,8 @@ int wolfSSL_X509_REQ_add1_attr_by_NID(WOLFSSL_X509 *req,
1409814098
}
1409914099
}
1410014100
ret = wolfSSL_sk_push(req->reqAttributes, attr);
14101-
if (ret != WOLFSSL_SUCCESS) {
14101+
if ((ret != WOLFSSL_SUCCESS) || (req->reqAttributes->type == STACK_TYPE_CIPHER)) {
14102+
/* CIPHER type makes a copy */
1410214103
wolfSSL_X509_ATTRIBUTE_free(attr);
1410314104
}
1410414105
}

0 commit comments

Comments
 (0)