mirror of
https://github.com/openssl/openssl.git
synced 2024-11-23 18:13:39 +08:00
Fix a similar memory leak in SXNET_add_id_INTEGER
Even in the good case there was memory leak here. Add a simple test case to have at least some test coverage. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/23234)
This commit is contained in:
parent
0151e77219
commit
3980118484
@ -204,6 +204,7 @@ int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *zone, const char *user,
|
|||||||
ERR_raise(ERR_LIB_X509V3, ERR_R_CRYPTO_LIB);
|
ERR_raise(ERR_LIB_X509V3, ERR_R_CRYPTO_LIB);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
ASN1_INTEGER_free(id->zone);
|
||||||
id->zone = zone;
|
id->zone = zone;
|
||||||
*psx = sx;
|
*psx = sx;
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -15,7 +15,7 @@ use OpenSSL::Test qw/:DEFAULT srctop_file/;
|
|||||||
|
|
||||||
setup("test_req");
|
setup("test_req");
|
||||||
|
|
||||||
plan tests => 106;
|
plan tests => 107;
|
||||||
|
|
||||||
require_ok(srctop_file('test', 'recipes', 'tconversion.pl'));
|
require_ok(srctop_file('test', 'recipes', 'tconversion.pl'));
|
||||||
|
|
||||||
@ -52,6 +52,7 @@ ok(!run(app([@addext_args, "-addext", $val, "-addext", $val])));
|
|||||||
ok(!run(app([@addext_args, "-addext", $val, "-addext", $val2])));
|
ok(!run(app([@addext_args, "-addext", $val, "-addext", $val2])));
|
||||||
ok(!run(app([@addext_args, "-addext", $val, "-addext", $val3])));
|
ok(!run(app([@addext_args, "-addext", $val, "-addext", $val3])));
|
||||||
ok(!run(app([@addext_args, "-addext", $val2, "-addext", $val3])));
|
ok(!run(app([@addext_args, "-addext", $val2, "-addext", $val3])));
|
||||||
|
ok(run(app([@addext_args, "-addext", "SXNetID=1:one, 2:two, 3:three"])));
|
||||||
|
|
||||||
# If a CSR is provided with neither of -key or -CA/-CAkey, this should fail.
|
# If a CSR is provided with neither of -key or -CA/-CAkey, this should fail.
|
||||||
ok(!run(app(["openssl", "req", "-x509",
|
ok(!run(app(["openssl", "req", "-x509",
|
||||||
|
Loading…
Reference in New Issue
Block a user