• George Fleury's avatar
    Fix memory leak · fba4818a
    George Fleury authored
    I was debbuging some code tonight and i found a pointer that is not been
    freed, so i think there is maybe a memory leak, so it is...
    
    there is the malloc caller reverse order:
    
    ( malloc cl->statEncList )
    	<- rfbStatLookupEncoding
    	<- rfbStatRecordEncodingSent
    	<- rfbSendCursorPos
    	<- rfbSendFramebufferUpdate
    	<- rfbProcessEvents
    
    I didnt look the whole libvncserver api, but i am using
    rfbReverseConnection with rfbProcessEvents, and then when the client
    connection dies, i am calling a rfbShutdownServer and rfbScreenCleanup,
    but the malloc at rfbStatLookupEncoding isnt been freed.
    
    So to free the stats i added a rfbResetStats(cl) after rfbPrintStats(cl)
    at rfbClientConnectionGone in rfbserver.c before free the cl pointer. (at
    rfbserver.c line 555). And this, obviously, is correcting the memory leak.
    Signed-off-by: 's avatarJohannes Schindelin <johannes.schindelin@gmx.de>
    fba4818a
Name
Last commit
Last update
VisualNaCro Loading commit data...
classes Loading commit data...
client_examples Loading commit data...
common Loading commit data...
examples Loading commit data...
libvncclient Loading commit data...
libvncserver Loading commit data...
rfb Loading commit data...
test Loading commit data...
utils Loading commit data...
vncterm Loading commit data...
x11vnc Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CMakeLists.txt Loading commit data...
COPYING Loading commit data...
ChangeLog Loading commit data...
Doxyfile Loading commit data...
INSTALL Loading commit data...
LibVNCServer.spec.in Loading commit data...
Makefile.am Loading commit data...
NEWS Loading commit data...
README Loading commit data...
TODO Loading commit data...
acinclude.m4 Loading commit data...
autogen.sh Loading commit data...
configure.ac Loading commit data...
libvncclient.pc.in Loading commit data...
libvncserver-config.in Loading commit data...
libvncserver.pc.in Loading commit data...
ltmain.sh Loading commit data...
prepare_x11vnc_dist.sh Loading commit data...
tightvnc-1.3dev5-vncviewer-alpha-cursor.patch Loading commit data...