RT RT/krbdev.mit.edu: Ticket #7090 krb5_gss_get_name_attribute minor cleanup issue Signed in as guest.
[Logout]

[Home] [Search] [Configuration]

[Display] [History] [Basics] [Dates] [People] [Links] [Jumbo]

 
 

 The Basics  
Id
7090
Status
open
Worked
0 min
Priority
0/0
Queue
krb5
 

 Keyword Selections  
Component
Tags
Version_reported
Version_Fixed
Target_Version
 

 Relationships  
Depends on:
Depended on by:
Parents:
Children:

Refers to:
Referred to by:
 
 Dates  
Created: Tue Feb 14 13:36:47 2012
Starts: Not set
Started: Not set
Last Contact: Not set
Due: Not set
Updated: Tue Feb 14 13:36:47 2012 by ghudson
 

 People  
Owner
 Nobody
Requestors
 ghudson@mit.edu
Cc
 
AdminCc
 
 

 More about Greg Hudson  
Comments about this user:
No comment entered about this user
This user's 25 highest priority tickets:
 

History   Display mode: [Brief headers] [Full headers]
      Tue Feb 14 13:36:47 2012  ghudson - Ticket created    
     
Subject: krb5_gss_get_name_attribute minor cleanup issue

When krb5_gss_get_name_attribute finishes retrieving attributes with
krb5_authdata_get_attribute, it needs to convert to krb5_data objects to
GSS buffers, which on Windows means reallocating and copying.

Currently, if the second of those buffer conversions fails, allocated
memory for the first buffer has already been transferred to caller
control.  This could result in a leak, since a caller who gets an error
return from gss_get_name_attribute won't necessarily release the buffers
it passed in.

To fix this cleanly, the code should be restructured so that buffer
conversions are performed before success is determined, with the results
stored in local variables which are cleaned up on failure.  Then, that
memory can be transferred to caller variables in the final part of the
function with error-free assignments.


Download (untitled) 833b