check if scconf_find_blocks returned NULL

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2714 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
aj 2005-12-05 21:38:33 +00:00
parent 686297304a
commit 4801c7eadd
1 changed files with 2 additions and 1 deletions

View File

@ -528,7 +528,8 @@ static int ctapi_init(sc_context_t *ctx, void **reader_data)
for (i = 0; ctx->conf_blocks[i] != NULL; i++) {
blocks = scconf_find_blocks(ctx->conf, ctx->conf_blocks[i],
"reader_driver", "ctapi");
conf_block = blocks[0];
if (blocks && blocks[0])
conf_block = blocks[0];
free(blocks);
if (conf_block != NULL)
break;