fixed coverity issues
- CID 145623 (#1 of 1): Resource leak (RESOURCE_LEAK) - CID 269069 (#1 of 1): Resource leak (RESOURCE_LEAK) - CID undefined (#1 of 1): Dereference before null check (REVERSE_INULL)
This commit is contained in:
parent
e1bc515363
commit
148bc25238
|
@ -158,8 +158,10 @@ static void print_hex(const u8 * buf, size_t buflen, size_t depth)
|
||||||
char *lines = malloc(lines_len);
|
char *lines = malloc(lines_len);
|
||||||
char *line = lines;
|
char *line = lines;
|
||||||
|
|
||||||
if (buf == NULL || buflen == 0 || lines == NULL)
|
if (buf == NULL || buflen == 0 || lines == NULL) {
|
||||||
|
free(lines);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
sc_hex_dump(buf, buflen, lines, lines_len);
|
sc_hex_dump(buf, buflen, lines, lines_len);
|
||||||
|
|
||||||
|
|
|
@ -808,6 +808,7 @@ int sc_context_create(sc_context_t **ctx_out, const sc_context_param_t *parm)
|
||||||
set_defaults(ctx, &opts);
|
set_defaults(ctx, &opts);
|
||||||
|
|
||||||
if (0 != list_init(&ctx->readers)) {
|
if (0 != list_init(&ctx->readers)) {
|
||||||
|
sc_release_context(ctx);
|
||||||
return SC_ERROR_OUT_OF_MEMORY;
|
return SC_ERROR_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
list_attributes_seeker(&ctx->readers, reader_list_seeker);
|
list_attributes_seeker(&ctx->readers, reader_list_seeker);
|
||||||
|
|
|
@ -1618,7 +1618,7 @@ pkcs15_login(struct sc_pkcs11_slot *slot, CK_USER_TYPE userType,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (userType == CKU_CONTEXT_SPECIFIC && pin_info) {
|
if (userType == CKU_CONTEXT_SPECIFIC) {
|
||||||
int auth_meth_saved = pin_info->auth_method;
|
int auth_meth_saved = pin_info->auth_method;
|
||||||
|
|
||||||
sc_log(context, "Setting SC_AC_CONTEXT_SPECIFIC");
|
sc_log(context, "Setting SC_AC_CONTEXT_SPECIFIC");
|
||||||
|
|
Loading…
Reference in New Issue