diff --git a/src/WINNT/afsd/afskfw.c b/src/WINNT/afsd/afskfw.c index 7123c45123..4a4a07e1c1 100644 --- a/src/WINNT/afsd/afskfw.c +++ b/src/WINNT/afsd/afskfw.c @@ -1422,7 +1422,8 @@ KFW_AFS_destroy_tickets_for_cell(char * cell) } free(principals); } - pkrb5_free_context(ctx); + if (ctx) + pkrb5_free_context(ctx); return 0; } @@ -1476,7 +1477,8 @@ KFW_AFS_destroy_tickets_for_principal(char * user) free(cells); } - pkrb5_free_context(ctx); + if (ctx) + pkrb5_free_context(ctx); return 0; } @@ -1700,7 +1702,8 @@ KFW_AFS_renew_token_for_cell(char * cell) code = -1; // we did not renew the tokens cleanup: - pkrb5_free_context(ctx); + if (ctx) + pkrb5_free_context(ctx); return (code ? FALSE : TRUE); }