Skip to content

Memory leaks detected in libvncserver (version 0.9.14) by Svacer static analyzer #724

Description

@Rakhmatula

Hello!

During static analysis of libvncserver version 0.9.14 using the Svacer tool, memory leaks were identified in the following locations:

1. libvncserver/cursor.c:54
Function call rfbMakeRichCursorFromXCursor(cl->screen, pCursor). Memory is allocated at line libvncserver/cursor.c:480, but there is no corresponding deallocation later in the code, resulting in a memory leak.

2. libvncserver/cursor.c:58
Function call rfbMakeXCursorFromRichCursor(cl->screen, pCursor). Memory is allocated at line libvncserver/cursor.c:403, but no deallocation is present.

3. libvncserver/rfbserver.c:3058
Variable iterator is created but initialized only at line libvncserver/rfbserver.c:3058 inside the condition:

if (cl->lastDesktopSizeChangeError == 0)

The function rfbGetClientIterator is called, which at line libvncserver/rfbserver.c:169 allocates memory via malloc(). No memory deallocation is found later in the code, causing another leak.

Please leave a review, this will help determine if the static analysis warning is a false positive or if it really needs to be fixed.
If there are already ready-made fixes, please attach the link

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions