Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
libvncserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
libvncserver
Commits
1955526d
Commit
1955526d
authored
May 28, 2006
by
steven_carr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Plugged some memory leakage
parent
2fa31ba4
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
85 additions
and
3 deletions
+85
-3
corre.c
libvncserver/corre.c
+11
-0
main.c
libvncserver/main.c
+5
-0
private.h
libvncserver/private.h
+19
-2
rfbserver.c
libvncserver/rfbserver.c
+2
-0
rre.c
libvncserver/rre.c
+13
-0
ultra.c
libvncserver/ultra.c
+22
-1
zlib.c
libvncserver/zlib.c
+13
-0
No files found.
libvncserver/corre.c
View file @
1955526d
...
...
@@ -50,6 +50,17 @@ static uint32_t getBgColour(char *data, int size, int bpp);
static
rfbBool
rfbSendSmallRectEncodingCoRRE
(
rfbClientPtr
cl
,
int
x
,
int
y
,
int
w
,
int
h
);
void
rfbCoRRECleanup
(
rfbScreenInfoPtr
screen
)
{
if
(
rreBeforeBufSize
)
{
free
(
rreBeforeBuf
);
rreBeforeBufSize
=
0
;
}
if
(
rreAfterBufSize
)
{
free
(
rreAfterBuf
);
rreAfterBufSize
=
0
;
}
}
/*
* rfbSendRectEncodingCoRRE - send an arbitrary size rectangle using CoRRE
...
...
libvncserver/main.c
View file @
1955526d
...
...
@@ -982,7 +982,12 @@ void rfbScreenCleanup(rfbScreenInfoPtr screen)
TINI_MUTEX
(
screen
->
cursorMutex
);
if
(
screen
->
cursor
&&
screen
->
cursor
->
cleanup
)
rfbFreeCursor
(
screen
->
cursor
);
rfbRRECleanup
(
screen
);
rfbCoRRECleanup
(
screen
);
rfbUltraCleanup
(
screen
);
#ifdef LIBVNCSERVER_HAVE_LIBZ
rfbZlibCleanup
(
screen
);
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
rfbTightCleanup
(
screen
);
#endif
...
...
libvncserver/private.h
View file @
1955526d
...
...
@@ -17,11 +17,28 @@ rfbClientPtr rfbClientIteratorHead(rfbClientIteratorPtr i);
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
extern
void
rfbTightCleanup
(
rfbScreenInfoPtr
screen
);
#endif
#endif
/* from zlib.c */
extern
void
rfbZlibCleanup
(
rfbScreenInfoPtr
screen
);
/* from zrle.c */
void
rfbFreeZrleData
(
rfbClientPtr
cl
);
#endif
/* from ultra.c */
extern
void
rfbUltraCleanup
(
rfbScreenInfoPtr
screen
);
extern
void
rfbFreeUltraData
(
rfbClientPtr
cl
);
/* from rre.c */
extern
void
rfbRRECleanup
(
rfbScreenInfoPtr
screen
);
/* from corre.c */
extern
void
rfb
FreeZrleData
(
rfbClientPtr
cl
);
extern
void
rfb
CoRRECleanup
(
rfbScreenInfoPtr
screen
);
#endif
libvncserver/rfbserver.c
View file @
1955526d
...
...
@@ -484,6 +484,8 @@ rfbClientConnectionGone(rfbClientPtr cl)
rfbFreeZrleData
(
cl
);
#endif
rfbFreeUltraData
(
cl
);
#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
if
(
cl
->
screen
->
backgroundLoop
!=
FALSE
)
{
int
i
;
...
...
libvncserver/rre.c
View file @
1955526d
...
...
@@ -48,6 +48,19 @@ static int subrectEncode32(uint32_t *data, int w, int h);
static
uint32_t
getBgColour
(
char
*
data
,
int
size
,
int
bpp
);
void
rfbRRECleanup
(
rfbScreenInfoPtr
screen
)
{
if
(
rreBeforeBufSize
)
{
free
(
rreBeforeBuf
);
rreBeforeBufSize
=
0
;
}
if
(
rreAfterBufSize
)
{
free
(
rreAfterBuf
);
rreAfterBufSize
=
0
;
}
}
/*
* rfbSendRectEncodingRRE - send a given rectangle using RRE encoding.
*/
...
...
libvncserver/ultra.c
View file @
1955526d
...
...
@@ -23,7 +23,7 @@ static char *lzoBeforeBuf = NULL;
static
int
lzoAfterBufSize
=
0
;
static
char
*
lzoAfterBuf
=
NULL
;
static
int
lzoAfterBufLen
;
static
int
lzoAfterBufLen
=
0
;
/*
* rfbSendOneRectEncodingZlib - send a given rectangle using one Zlib
...
...
@@ -32,6 +32,26 @@ static int lzoAfterBufLen;
#define MAX_WRKMEM ((LZO1X_1_MEM_COMPRESS) + (sizeof(lzo_align_t) - 1)) / sizeof(lzo_align_t)
void
rfbUltraCleanup
(
rfbScreenInfoPtr
screen
)
{
if
(
lzoBeforeBufSize
)
{
free
(
lzoBeforeBuf
);
lzoBeforeBufSize
=
0
;
}
if
(
lzoAfterBufSize
)
{
free
(
lzoAfterBuf
);
lzoAfterBufSize
=
0
;
}
}
void
rfbFreeUltraData
(
rfbClientPtr
cl
)
{
if
(
cl
->
compStreamInitedLZO
)
{
free
(
cl
->
lzoWrkMem
);
cl
->
compStreamInitedLZO
=
FALSE
;
}
}
static
rfbBool
rfbSendOneRectEncodingUltra
(
rfbClientPtr
cl
,
int
x
,
...
...
@@ -125,6 +145,7 @@ rfbSendOneRectEncodingUltra(rfbClientPtr cl,
memcpy
(
&
cl
->
updateBuf
[
cl
->
ublen
],
(
char
*
)
&
hdr
,
sz_rfbZlibHeader
);
cl
->
ublen
+=
sz_rfbZlibHeader
;
/* We might want to try sending the data directly... */
for
(
i
=
0
;
i
<
lzoAfterBufLen
;)
{
int
bytesToCopy
=
UPDATE_BUF_SIZE
-
cl
->
ublen
;
...
...
libvncserver/zlib.c
View file @
1955526d
...
...
@@ -47,6 +47,19 @@ static int zlibAfterBufSize = 0;
static
char
*
zlibAfterBuf
=
NULL
;
static
int
zlibAfterBufLen
;
void
rfbZlibCleanup
(
rfbScreenInfoPtr
screen
)
{
if
(
zlibBeforeBufSize
)
{
free
(
zlibBeforeBuf
);
zlibBeforeBufSize
=
0
;
}
if
(
zlibAfterBufSize
)
{
zlibAfterBufSize
=
0
;
free
(
zlibAfterBuf
);
}
}
/*
* rfbSendOneRectEncodingZlib - send a given rectangle using one Zlib
* rectangle encoding.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment