[PATCHES] fix a couple of memory leaks

Andreas Schneider asn at samba.org
Mon Jul 4 14:05:02 UTC 2016


On Monday, 4 July 2016 08:32:38 CEST Uri Simchoni wrote:
> On 07/04/2016 05:14 AM, Richard Sharpe wrote:
> > On Sun, Jul 3, 2016 at 1:23 PM, Uri Simchoni <uri at samba.org> wrote:
> > 
> > Could be hoist the *keytype = 0 to before the #ifdef? Something like this?
> > 
> > diff --git a/auth/kerberos/gssapi_pac.c b/auth/kerberos/gssapi_pac.c
> > index 685d0ec..0d0b4ee 100644
> > --- a/auth/kerberos/gssapi_pac.c
> > +++ b/auth/kerberos/gssapi_pac.c
> > @@ -246,6 +246,7 @@ NTSTATUS gssapi_get_session_key(TALLOC_CTX *mem_ctx,
> > 
> >                 int diflen, i;
> >                 const uint8_t *p;
> > 
> > +               *keytype = 0;
> > 
> >                 if (set->count < 2) {
> >  
> >  #ifdef HAVE_GSSKRB5_GET_SUBKEY
> > 
> > @@ -256,11 +257,7 @@ NTSTATUS gssapi_get_session_key(TALLOC_CTX *mem_ctx,
> > 
> >                         if (gss_maj == 0) {
> >                         
> >                                 *keytype = KRB5_KEY_TYPE(subkey);
> >                                 krb5_free_keyblock(NULL /* should be
> > 
> > krb5_context */, subkey);
> > -                       } else
> > -#else
> > -                       {
> > -                               *keytype = 0;
> > -                       }
> > +                       }
> > 
> >  #endif
> >  
> >                         gss_maj = gss_release_buffer_set(&gss_min, &set);
> > 
> > That seems to simplify the #ifdef stuff ...
> 
> Yeah, you're right. Attached fixed patch.

RB+
 
> Thanks,
> Uri.


-- 
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org
www.samba.org



More information about the samba-technical mailing list