Question about use of krb5_get_init_creds_opt_alloc

Markus Moeller huaraz at moeller.plus.com
Sun Dec 1 18:59:23 EST 2013


I have in my code the below section and get valgrind errors about lost 
blocks

==25011== 136 (80 direct, 56 indirect) bytes in 1 blocks are definitely lost 
in loss record 597 of 675
==25011==    at 0x4C2A0B4: calloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==25011==    by 0x6283977: gic_opte_alloc (gic_opt.c:172)
==25011==    by 0x6283AF9: krb5_get_init_creds_opt_alloc (gic_opt.c:200)



krb5_get_init_creds_opt *options = NULL;
krb5_get_init_creds_opt_alloc(kparam.context, &options))
krb5_get_init_creds_opt_init(options);
krb5_get_init_creds_keytab(kparam.context,
                                            creds,
                                            principal_list[i],
                                            keytab, 0, NULL,
                                            options);
if (options)
        krb5_get_init_creds_opt_free(kparam.context, options);

I did some debug and see that krb5_get_init_creds_keytab calls also 
krb5_get_init_creds_opt_free and "my" krb5_get_init_creds_opt_free seems not 
to free my allocated data as it returns here in 
krb5_get_init_creds_opt_free:

if (!krb5_gic_opt_is_extended(opt))
    return;


What did I do wrong ?  I use OpenSuse 12.3 with krb5 1.10.2


Thank you
Markus 




More information about the Kerberos mailing list