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.
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:54Function call
rfbMakeRichCursorFromXCursor(cl->screen, pCursor). Memory is allocated at linelibvncserver/cursor.c:480, but there is no corresponding deallocation later in the code, resulting in a memory leak.2.
libvncserver/cursor.c:58Function call
rfbMakeXCursorFromRichCursor(cl->screen, pCursor). Memory is allocated at linelibvncserver/cursor.c:403, but no deallocation is present.3.
libvncserver/rfbserver.c:3058Variable
iteratoris created but initialized only at linelibvncserver/rfbserver.c:3058inside the condition:The function
rfbGetClientIteratoris called, which at linelibvncserver/rfbserver.c:169allocates memory viamalloc(). 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.