tests: Avoid needless free and fix formatting

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Norbert Pocs <npocs@redhat.com>
This commit is contained in:
Jakub Jelen
2023-01-06 17:18:34 +01:00
parent dcfc8a2c5d
commit bb9c3245c4
2 changed files with 1 additions and 9 deletions

View File

@@ -205,7 +205,7 @@ torture_pki_ecdsa_publickey_from_privatekey_uri(void **state,
snprintf(pub_filename, sizeof(pub_filename), "%s%s%s", LIBSSH_ECDSA_TESTKEY, type, ".pub");
snprintf(pub_filename_generated, sizeof(pub_filename_generated), "%s%s%s",
LIBSSH_ECDSA_TESTKEY_PEM, type, "generated.pub");
LIBSSH_ECDSA_TESTKEY_PEM, type, "generated.pub");
snprintf(pub_filename_pem, sizeof(pub_filename_pem), "%s%s%s", LIBSSH_ECDSA_TESTKEY_PEM, type, ".pub");
rc = torture_read_one_line(pub_filename,
@@ -275,14 +275,12 @@ import_pubkey_without_loading_public_uri(void **state, const char *label)
rc = ssh_pki_export_pubkey_blob(privkey, &pblob);
assert_int_not_equal(rc, 0);
assert_null(pblob);
ssh_string_free(pblob);
rc = ssh_pki_export_privkey_to_pubkey(privkey, &pubkey);
assert_int_not_equal(rc, 0);
assert_null(pubkey);
SSH_KEY_FREE(privkey);
SSH_KEY_FREE(pubkey);
}
static void torture_pki_ecdsa_import_pubkey_without_loading_public_uri_256(void **state)
@@ -547,9 +545,6 @@ static void torture_pki_ecdsa_import_pubkey_uri_invalid_configurations(void **st
&pubkey);
assert_int_not_equal(rc, 0);
assert_null(pubkey);
SSH_KEY_FREE(privkey);
SSH_KEY_FREE(pubkey);
}
int torture_run_tests(void) {

View File

@@ -273,9 +273,6 @@ static void torture_pki_rsa_uri_invalid_configurations(void **state)
&privkey);
assert_int_not_equal(rc, 0);
assert_null(privkey);
SSH_KEY_FREE(pubkey);
SSH_KEY_FREE(privkey);
}
int