Skip to content

Commit

Permalink
Free preexisting obj contents in setters
Browse files Browse the repository at this point in the history
  • Loading branch information
WillChilds-Klein committed Feb 23, 2024
1 parent 9d475bc commit 8c1291f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crypto/x509/x509_lu.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ int X509_OBJECT_set1_X509(X509_OBJECT *a, X509 *obj) {
return 0;
}

X509_OBJECT_free_contents(a);
a->type = X509_LU_X509;
a->data.x509 = obj;
return 1;
Expand All @@ -435,6 +436,7 @@ int X509_OBJECT_set1_X509_CRL(X509_OBJECT *a, X509_CRL *obj) {
return 0;
}

X509_OBJECT_free_contents(a);
a->type = X509_LU_CRL;
a->data.crl = obj;
return 1;
Expand Down

0 comments on commit 8c1291f

Please sign in to comment.