From: Ezra Peisach Date: Mon, 28 Feb 2000 16:32:47 +0000 (+0000) Subject: * proto_serv.c (proto_serv): For error return,strdup the returned X-Git-Tag: krb5-1.2-beta1~37 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=11725a734ce7c730ca5ea65b7492c1bc451f7e27;p=krb5.git * proto_serv.c (proto_serv): For error return,strdup the returned value from error_message to maintain its const status. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12087 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kadmin/v5passwdd/ChangeLog b/src/kadmin/v5passwdd/ChangeLog index f94ed38bf..a63cc97ce 100644 --- a/src/kadmin/v5passwdd/ChangeLog +++ b/src/kadmin/v5passwdd/ChangeLog @@ -1,3 +1,8 @@ +2000-02-28 Ezra Peisach + + * proto_serv.c (proto_serv): For error return,strdup the returned + value from error_message to maintain its const status. + 1999-10-26 Tom Yu * Makefile.in: Clean up usage of CFLAGS, CPPFLAGS, DEFS, DEFINES, diff --git a/src/kadmin/v5passwdd/proto_serv.c b/src/kadmin/v5passwdd/proto_serv.c index 6c7e22772..413c5efe8 100644 --- a/src/kadmin/v5passwdd/proto_serv.c +++ b/src/kadmin/v5passwdd/proto_serv.c @@ -815,12 +815,13 @@ proto_serv(kcontext, my_id, cl_sock, sv_p, cl_p) if (errbuf.error > 127) errbuf.error = KRB5KRB_ERR_GENERIC; /* Format the error message in our language */ - errmsg = error_message(kret); + errmsg = strdup(error_message(kret)); errbuf.text.length = strlen(errmsg); errbuf.text.data = errmsg; er_kret = krb5_mk_error(kcontext, &errbuf, &errout); if (!er_kret) krb5_write_message(kcontext, (krb5_pointer) &cl_sock, &errout); + if(errmsg) free(errmsg); free(errbuf.text.data); krb5_free_data_contents(kcontext, &errout); }