From: Ezra Peisach Date: Mon, 24 May 2004 20:24:23 +0000 (+0000) Subject: * t_ser.c (ser_keytab_test): Cleanup memory leak of forgetting to X-Git-Tag: krb5-1.4-beta1~404 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=600f5cacb80a15eec31e66eefe9dd6bc4f3d296e;p=krb5.git * t_ser.c (ser_keytab_test): Cleanup memory leak of forgetting to close keytab. * chpw.c: Add parenthesis around assignments in conditionals. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16356 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 736eeba80..3bc26d062 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,10 @@ +2004-05-24 Ezra Peisach + + * t_ser.c (ser_keytab_test): Cleanup memory leak of forgetting to + close keytab. + + * chpw.c: Add parenthesis around assignments in conditionals. + 2004-05-12 Jeffrey Altman * send_tgs.c: krb5_send_tgs() was broken in the case of a KRB_ERROR diff --git a/src/lib/krb5/krb/chpw.c b/src/lib/krb5/krb/chpw.c index a455cc40b..640124601 100644 --- a/src/lib/krb5/krb/chpw.c +++ b/src/lib/krb5/krb/chpw.c @@ -249,13 +249,12 @@ krb5int_mk_setpw_req( krb5_data *encoded_setpw; char *ptr; - int count = 2; cipherpw.data = NULL; cipherpw.length = 0; - if (ret = krb5_auth_con_setflags(context, auth_context, - KRB5_AUTH_CONTEXT_DO_SEQUENCE)) + if ((ret = krb5_auth_con_setflags(context, auth_context, + KRB5_AUTH_CONTEXT_DO_SEQUENCE))) return(ret); ret = encode_krb5_setpw_req(targprinc, passwd, &encoded_setpw); @@ -318,7 +317,6 @@ krb5int_rd_setpw_rep( krb5_context context, krb5_auth_context auth_context, krb5 krb5_error_code ret; krb5_data cipherresult; krb5_data clearresult; - krb5_replay_data replay; krb5_keyblock *tmpkey; /* ** validate the packet length - @@ -333,10 +331,10 @@ krb5int_rd_setpw_rep( krb5_context context, krb5_auth_context auth_context, krb5 */ if (krb5_is_krb_error(packet)) { krb5_error *krberror; - if (ret = krb5_rd_error(context, packet, &krberror)) + if ((ret = krb5_rd_error(context, packet, &krberror))) return(ret); if (krberror->e_data.data == NULL) { - ret = ERROR_TABLE_BASE_krb5 + krberror->error; + ret = ERROR_TABLE_BASE_krb5 + (krb5_error_code) krberror->error; krb5_free_error(context, krberror); return (ret); } diff --git a/src/lib/krb5/krb/t_ser.c b/src/lib/krb5/krb/t_ser.c index 37d79dacd..61c6e4797 100644 --- a/src/lib/krb5/krb/t_ser.c +++ b/src/lib/krb5/krb/t_ser.c @@ -439,6 +439,8 @@ ser_keytab_test(krb5_context kcontext, int verbose) sprintf(ccname, "WRFILE:temp_kt_%d", (int) getpid()); if ((kret = krb5_kt_resolve(kcontext, ccname, &keytab))) kret = krb5_kt_register(kcontext, &krb5_ktf_writable_ops); + else + kret = krb5_kt_close(kcontext, keytab); if (!kret && !(kret = krb5_kt_resolve(kcontext, ccname, &keytab)) && !(kret = ser_data(verbose, "> Resolved WRFILE keytab",