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);
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);
sc_release_context(ctx);
return err;
}

View File

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

View File

@ -288,8 +288,7 @@ end:
sc_unlock(card);
sc_disconnect_card(card);
}
if (ctx)
sc_release_context(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);
sc_disconnect_card(card);
sc_release_context(ctx);
return err;
}

View File

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

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);
sc_pkcs15_unbind(p15card);
sc_disconnect_card(card);
sc_release_context(ctx);
return err;
}

View File

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