fixed 333707 Dereference before null check

This commit is contained in:
Frank Morgner 2019-03-06 00:39:53 +01:00
parent 8fbd0b3ee1
commit 070370895f
8 changed files with 12 additions and 26 deletions

View File

@ -1132,7 +1132,6 @@ int main(int argc, char *argv[])
sc_unlock(card);
sc_disconnect_card(card);
}
if (ctx)
sc_release_context(ctx);
return err;
}

View File

@ -1117,7 +1117,6 @@ end:
sc_unlock(card);
sc_disconnect_card(card);
}
if (ctx)
sc_release_context(ctx);
return err;
}

View File

@ -232,7 +232,6 @@ dnie_tool_end:
sc_unlock(card);
sc_disconnect_card(card);
}
if (ctx)
sc_release_context(ctx);
return err;
}

View File

@ -288,7 +288,6 @@ end:
sc_unlock(card);
sc_disconnect_card(card);
}
if (ctx)
sc_release_context(ctx);
return err;

View File

@ -909,10 +909,7 @@ int main(int argc, char *argv[])
action_count--;
}
end:
if (card) {
sc_disconnect_card(card);
}
if (ctx)
sc_release_context(ctx);
return err;
}

View File

@ -662,7 +662,6 @@ end:
sc_unlock(card);
sc_disconnect_card(card);
}
if (ctx)
sc_release_context(ctx);
ERR_print_errors_fp(stderr);

View File

@ -2427,11 +2427,8 @@ int main(int argc, char *argv[])
action_count--;
}
end:
if (p15card)
sc_pkcs15_unbind(p15card);
if (card)
sc_disconnect_card(card);
if (ctx)
sc_release_context(ctx);
return err;
}

View File

@ -1844,10 +1844,7 @@ int main(int argc, char *argv[])
fail:
err = 1;
end:
if (card) {
sc_disconnect_card(card);
}
if (ctx)
sc_release_context(ctx);
ERR_print_errors_fp(stderr);