diff options
author | George Fleury <gfleury@gmail.com> | 2011-10-16 22:02:11 -0500 |
---|---|---|
committer | Johannes Schindelin <johannes.schindelin@gmx.de> | 2011-10-16 22:04:12 -0500 |
commit | fba4818ae850fb8b8b493a12fbb052f5f847489e (patch) | |
tree | c48ca37a542b16629185eb810139285627382b1b /libvncserver/main.c | |
parent | 9d0b80059a105ce68edef8e12161e73ec9a4eda7 (diff) | |
download | libtdevnc-fba4818ae850fb8b8b493a12fbb052f5f847489e.tar.gz libtdevnc-fba4818ae850fb8b8b493a12fbb052f5f847489e.zip |
Fix memory leak
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: Johannes Schindelin <johannes.schindelin@gmx.de>
Diffstat (limited to 'libvncserver/main.c')
0 files changed, 0 insertions, 0 deletions