X-Git-Url: http://git.samba.org/?a=blobdiff_plain;f=client%2Fcifs.upcall.c;h=42632a0da09308ebc1f54256932b489626253c18;hb=a8cc2fa09ed43a167f62711bef363a5ac335dc78;hp=bfc70d15ed116e9d93b09026565e244ae4890b85;hpb=8aef63d2430a3e96b1dbf3f6595bdf78f703c778;p=abartlet%2Fsamba.git%2F.git diff --git a/client/cifs.upcall.c b/client/cifs.upcall.c index bfc70d15ed1..42632a0da09 100644 --- a/client/cifs.upcall.c +++ b/client/cifs.upcall.c @@ -56,6 +56,7 @@ get_tgt_time(const char *ccname) { krb5_principal principal; time_t credtime = 0; char *realm = NULL; + TALLOC_CTX *mem_ctx; if (krb5_init_context(&context)) { syslog(LOG_DEBUG, "%s: unable to init krb5 context", __func__); @@ -87,9 +88,10 @@ get_tgt_time(const char *ccname) { goto err_ccstart; } + mem_ctx = talloc_init("cifs.upcall"); while (!credtime && !krb5_cc_next_cred(context, ccache, &cur, &creds)) { char *name; - if (smb_krb5_unparse_name(NULL, context, creds.server, &name)) { + if (smb_krb5_unparse_name(mem_ctx, context, creds.server, &name)) { syslog(LOG_DEBUG, "%s: unable to unparse name", __func__); goto err_endseq; } @@ -102,6 +104,7 @@ get_tgt_time(const char *ccname) { TALLOC_FREE(name); } err_endseq: + TALLOC_FREE(mem_ctx); krb5_cc_end_seq_get(context, ccache, &cur); err_ccstart: krb5_free_principal(context, principal);