Memory leak question in avc_context_to_sid question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a snippet of code in a bigger class:

        security_id_t sid = NULL, osid = NULL;
        if (avc_context_to_sid(*thisContext, &sid) < 0 ||
            avc_context_to_sid(*otherContext, &osid) < 0)
            rlog(LOG_ERR, "%s: avc_context_to_sid failed: %m", process_name);

        struct av_decision avd = {0,0,0,0,0};
        int astat = avc_has_perm_noaudit(sid, osid, SECCLASS_FILE, FILE__READ, &avcref, &avd);
        if (astat < 0 && errno != EACCES)
            rlog(LOG_ERR, "%s: avc_has_perm_noaudit failed: %m", process_name);

        decision = (avd.allowed & FILE__READ) == FILE__READ;
        if (sid)
            sidput(sid);
        if (osid)
            sidput(osid);
        dcache->put(hashKey, decision);

that valgrind says is leaking memory

==3000== 25,470 bytes in 346 blocks are definitely lost in loss record 9 of 9
==3000==    at 0x46DFAEE: malloc (vg_replace_malloc.c:207)
==3000==    by 0x71670EF: strdup (in /lib/libc-2.9.so)
==3000==    by 0x4826E14: (within /lib/libselinux.so.1)
==3000==    by 0x4826F66: (within /lib/libselinux.so.1)
==3000==    by 0x4824B2A: avc_context_to_sid_raw (in /lib/libselinux.so.1)
==3000==    by 0x4824C03: avc_context_to_sid (in /lib/libselinux.so.1)
...

am I missing a cleanup call somewhere? This is a fairly old libselinux (2.0.79-4) on a patched up Fedora 10.

joe



--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@xxxxxxxxxxxxx with
the words "unsubscribe selinux" without quotes as the message.


[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux