diff options
author | Victor Toso <victortoso@redhat.com> | 2015-03-27 15:25:59 +0100 |
---|---|---|
committer | Victor Toso <victortoso@redhat.com> | 2015-03-27 16:42:48 +0100 |
commit | 4835df0b642dfc963e7cbaabfe93da86482f0b93 (patch) | |
tree | 9d2c81ad04c14bc269572d001d3e8ececdb8ccb2 | |
parent | 4e9b291773ebcd27b9eed266c5bc113cddbe9214 (diff) |
uinput: fix small leak of screen_info
The following leak is fixed by this patch:
==2648== HEAP SUMMARY:
==2648== in use at exit: 104,699 bytes in 1,459 blocks
==2648== total heap usage: 14,177 allocs, 12,718 frees, 1,190,456 bytes allocated
==2648==
==2648== 16 bytes in 1 blocks are definitely lost in loss record 16 of 130
==2648== at 0x4C29BCF: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==2648== by 0x10B530: agent_read_complete (vdagentd.c:715)
==2648== by 0x10E8DC: udscs_read_complete (udscs.c:460)
==2648== by 0x10EAFC: udscs_do_read (udscs.c:515)
==2648== by 0x10E490: udscs_client_handle_fds (udscs.c:349)
==2648== by 0x10E402: udscs_server_handle_fds (udscs.c:337)
==2648== by 0x10BAB1: main_loop (vdagentd.c:844)
==2648== by 0x10A3E6: main (vdagentd.c:974)
==2648==
==2648== LEAK SUMMARY:
==2648== definitely lost: 16 bytes in 1 blocks
==2648== indirectly lost: 0 bytes in 0 blocks
==2648== possibly lost: 41,483 bytes in 1,268 blocks
==2648== still reachable: 63,200 bytes in 190 blocks
==2648== suppressed: 0 bytes in 0 blocks
==2648== Reachable blocks (those to which a pointer was found) are not shown.
==2648== To see them, rerun with: --leak-check=full --show-leak-kinds=all
-rw-r--r-- | src/vdagentd-uinput.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vdagentd-uinput.c b/src/vdagentd-uinput.c index 47e1b45..1ce9918 100644 --- a/src/vdagentd-uinput.c +++ b/src/vdagentd-uinput.c @@ -76,6 +76,10 @@ void vdagentd_uinput_destroy(struct vdagentd_uinput **uinputp) if (uinput->fd != -1) close(uinput->fd); + + if (uinput->screen_info != NULL) + free(uinput->screen_info); + free(uinput); *uinputp = NULL; } |