Skip to content

Commit

Permalink
Fix a possible memory leak in sxnet_v2i
Browse files Browse the repository at this point in the history
When a subsequent call to SXNET_add_id_asc fails
e.g. because user is a string larger than 64 char
or the zone is a duplicate zone id,
or the zone is not an integer,
a memory leak may be the result.
  • Loading branch information
bernd-edlinger committed Jan 8, 2024
1 parent ffed597 commit 4edf481
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crypto/x509/v3_sxnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,10 @@ static SXNET *sxnet_v2i(X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
int i;
for (i = 0; i < sk_CONF_VALUE_num(nval); i++) {
cnf = sk_CONF_VALUE_value(nval, i);
if (!SXNET_add_id_asc(&sx, cnf->name, cnf->value, -1))
if (!SXNET_add_id_asc(&sx, cnf->name, cnf->value, -1)) {
SXNET_free(sx);
return NULL;
}
}
return sx;
}
Expand Down

0 comments on commit 4edf481

Please sign in to comment.