[16074] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

[krbdev.mit.edu #8707] git commit

daemon@ATHENA.MIT.EDU (Greg Hudson via RT)
Fri Jun 29 22:06:23 2018

Mail-followup-to: rt@krbdev.mit.edu
mail-copies-to: never
From: "Greg Hudson via RT" <rt-comment@KRBDEV-PROD-APP-1.mit.edu>
In-Reply-To: <rt-8707@krbdev.mit.edu>
Message-ID: <rt-8707-48694.3.86098444538469@krbdev.mit.edu>
To: "'AdminCc of krbdev.mit.edu Ticket #8707'":;
Date: Fri, 29 Jun 2018 22:06:16 -0400 (EDT)
Reply-To: rt-comment@KRBDEV-PROD-APP-1.mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: krb5-bugs-bounces@mit.edu


Improve ulog memory hygiene

Add a helper create_log_context() to initialize a krb5_context's
kdblog_context field, setting ulogfd to -1.  Use it in ulog_set_role()
and ulog_map().  In ulog_fini(), release ulogfd if it is not -1.

In ulog_map(), add a cleanup label and use it to finalize the log
context on failure, so that we don't (trivially) leak the mapped ulog.
To reduce the number of "retval = errno;" statements required for this
change, make extend_file_to() return a krb5_error_code.

The ulog leak on error was reported by Bean Zhang.

https://github.com/krb5/krb5/commit/7aff2511c0dab5c51b1155ca2952521ffb925fc5
Author: Greg Hudson <ghudson@mit.edu>
Commit: 7aff2511c0dab5c51b1155ca2952521ffb925fc5
Branch: master
 src/lib/kdb/kdb_log.c |  125 +++++++++++++++++++++++++-----------------------
 src/slave/kproplog.c  |    4 +-
 2 files changed, 68 insertions(+), 61 deletions(-)

_______________________________________________
krb5-bugs mailing list
krb5-bugs@mit.edu
https://mailman.mit.edu/mailman/listinfo/krb5-bugs

home help back first fref pref prev next nref lref last post