[krbdev.mit.edu #6284] memory leaks in error conditions
Zhanna Tsitkova via RT
rt-comment at krbdev.mit.edu
Thu Dec 4 13:42:44 EST 2008
diff -Nur -x '*~' -x '*.orig' -x '*.rej' -x '*.pbxbtree' -x '*.pbxindex' -x lha.mode1v3 -x lha.mode2v3 -x lha.pbxuser -x windows -x .DS_Store Kerberos.AEP-6.5fc1.orig/KerberosFramework/Kerberos5/Sources/kadmin/server/schpw.c Kerberos.AEP-6.5fc1/KerberosFramework/Kerberos5/Sources/kadmin/server/schpw.c
--- Kerberos.AEP-6.5fc1.orig/KerberosFramework/Kerberos5/Sources/kadmin/server/schpw.c 2008-11-09 17:47:50.000000000 -0800
+++ Kerberos.AEP-6.5fc1/KerberosFramework/Kerberos5/Sources/kadmin/server/schpw.c 2008-11-09 19:22:59.000000000 -0800
@@ -37,6 +37,7 @@
char *clientstr;
size_t clen;
char *cdots;
+ const char *errmsg = NULL;
ret = 0;
rep->length = 0;
@@ -221,11 +222,15 @@
clen = strlen(clientstr);
trunc_name(&clen, &cdots);
+ if (ret)
+ errmsg = krb5_get_error_message (context, ret);
krb5_klog_syslog(LOG_NOTICE, "chpw request from %s for %.*s%s: %s",
inet_ntoa(sockfrom->sin_addr),
(int) clen, clientstr, cdots,
- ret ? krb5_get_error_message (context, ret) : "success");
+ errmsg ? errmsg : "success");
krb5_free_unparsed_name(context, clientstr);
+ if (errmsg)
+ krb5_free_error_message(context, errmsg);
if (ret) {
if ((ret != KADM5_PASS_Q_TOOSHORT) &&
More information about the krb5-bugs
mailing list