From 459bafc059b082b99d81082a1f6e4ff93aee626d Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Wed, 15 Apr 2009 20:06:49 +0000 Subject: [PATCH] send_tgs.c static analyzer friendliness pull up r22002 from trunk ------------------------------------------------------------------------ r22002 | ghudson | 2009-02-13 17:00:47 -0500 (Fri, 13 Feb 2009) | 4 lines Changed paths: M /trunk/src/lib/krb5/krb/send_tgs.c In tgs_construct_tgsreq, free scratch even if scratch->data is NULL. (Which probably can't happen, but static analyzers don't know that.) Also protect scratch from being freed before initialization. ticket: 6465 tags: pullup target_version: 1.7 version_fixed: 1.7 git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-7@22237 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/send_tgs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/krb5/krb/send_tgs.c b/src/lib/krb5/krb/send_tgs.c index 998b9b48b..52c5e27e3 100644 --- a/src/lib/krb5/krb/send_tgs.c +++ b/src/lib/krb5/krb/send_tgs.c @@ -55,7 +55,7 @@ tgs_construct_tgsreq(krb5_context context, krb5_data *in_data, krb5_checksum checksum; krb5_authenticator authent; krb5_ap_req request; - krb5_data * scratch; + krb5_data * scratch = NULL; krb5_data * toutbuf; checksum.contents = NULL; @@ -119,8 +119,8 @@ if (request.ticket) if (scratch != NULL && scratch->data != NULL) { zap(scratch->data, scratch->length); free(scratch->data); - free(scratch); } + free(scratch); return retval; } -- 2.26.2