[PATCHES] fix a couple of memory leaks

Richard Sharpe realrichardsharpe at gmail.com
Mon Jul 4 18:24:44 UTC 2016


On Mon, Jul 4, 2016 at 7:05 AM, Andreas Schneider <asn at samba.org> wrote:
> 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.

Pushed with both reviews. Autobuild going now.

-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)



More information about the samba-technical mailing list