Commit 3910b6a8 authored by Michal Privoznik's avatar Michal Privoznik

libvirtGuestTable.c: Free duplicated domain name

The domain name is duplicated in insertGuest() but it's never
freed leading to the following memleak:

 46 bytes in 6 blocks are definitely lost in loss record 795 of 944
    at 0x4C2CF0F: malloc (vg_replace_malloc.c:299)
    by 0x6E6FE79: strdup (in /lib64/libc-2.26.so)
    by 0x10E665: insertGuest (libvirtSnmp.c:160)
    by 0x10EA7D: libvirtSnmpLoadGuests (libvirtSnmp.c:285)
    by 0x10DB01: libvirtGuestTable_container_load (libvirtGuestTable_data_access.c:230)
    by 0x1133E3: _cache_load (libvirtGuestTable_interface.c:1557)
    by 0x5F2955B: _cache_load (in /usr/lib64/libnetsnmpagent.so.30.0.3)
    by 0x5F2A7FF: netsnmp_cache_helper_handler (in /usr/lib64/libnetsnmpagent.so.30.0.3)
    by 0x5F3CE2C: netsnmp_call_next_handler (in /usr/lib64/libnetsnmpagent.so.30.0.3)
    by 0x5F316B6: table_helper_handler (in /usr/lib64/libnetsnmpagent.so.30.0.3)
    by 0x5F3C8E6: netsnmp_call_handlers (in /usr/lib64/libnetsnmpagent.so.30.0.3)
    by 0x5F4A65E: handle_var_requests (in /usr/lib64/libnetsnmpagent.so.30.0.3)
Signed-off-by: 's avatarMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: 's avatarMartin Kletzander <mkletzan@redhat.com>
parent 0ca48c8a
......@@ -157,9 +157,7 @@ void libvirtGuestTable_rowreq_ctx_cleanup(libvirtGuestTable_rowreq_ctx *rowreq_c
netsnmp_assert(NULL != rowreq_ctx);
/*
* TODO:211:o: |-> Perform extra libvirtGuestTable rowreq cleanup.
*/
free(rowreq_ctx->data.libvirtGuestName);
} /* libvirtGuestTable_rowreq_ctx_cleanup */
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment