summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorfrueauf <frueauf>1998-10-01 20:19:48 +0000
committerfrueauf <frueauf>1998-10-01 20:19:48 +0000
commit67a403c5e22a164a1057a88bd40479158552e26f (patch)
tree7da170c2cf3da6f61b01f99e95406cf5faa2b8d4 /net
parent82cccbf2bd8e25332907c8a3d1fb7e1bf34cccae (diff)
downloadpkgsrc-67a403c5e22a164a1057a88bd40479158552e26f.tar.gz
Fix memory leak in the rfbserver code, closes pr 6163 by Jeff Rizzo.
Diffstat (limited to 'net')
-rw-r--r--net/vnc/patches/patch-ad73
1 files changed, 73 insertions, 0 deletions
diff --git a/net/vnc/patches/patch-ad b/net/vnc/patches/patch-ad
new file mode 100644
index 00000000000..3ce9673a6e4
--- /dev/null
+++ b/net/vnc/patches/patch-ad
@@ -0,0 +1,73 @@
+$NetBSD: patch-ad,v 1.1 1998/10/01 20:19:48 frueauf Exp $
+
+--- Xvnc/programs/Xserver/hw/vnc/rfbserver.c-orig Mon Jul 13 18:01:52 1998
++++ Xvnc/programs/Xserver/hw/vnc/rfbserver.c Thu Oct 1 21:58:27 1998
+@@ -816,10 +816,15 @@
+ ublen = sz_rfbFramebufferUpdateMsg;
+
+ if (REGION_NOTEMPTY(pScreen,&updateCopyRegion)) {
+- if (!rfbSendCopyRegion(cl,&updateCopyRegion,dx,dy))
++ if (!rfbSendCopyRegion(cl,&updateCopyRegion,dx,dy)) {
++ REGION_UNINIT(pScreen,&updateRegion);
++ REGION_UNINIT(pScreen,&updateCopyRegion);
+ return FALSE;
++ }
+ }
+
++ REGION_UNINIT(pScreen,&updateCopyRegion);
++
+ for (i = 0; i < REGION_NUM_RECTS(&updateRegion); i++) {
+ int x = REGION_RECTS(&updateRegion)[i].x1;
+ int y = REGION_RECTS(&updateRegion)[i].y1;
+@@ -831,24 +836,34 @@
+
+ switch (cl->preferredEncoding) {
+ case rfbEncodingRaw:
+- if (!rfbSendRectEncodingRaw(cl, x, y, w, h))
++ if (!rfbSendRectEncodingRaw(cl, x, y, w, h)) {
++ REGION_UNINIT(pScreen,&updateRegion);
+ return FALSE;
++ }
+ break;
+ case rfbEncodingRRE:
+- if (!rfbSendRectEncodingRRE(cl, x, y, w, h))
++ if (!rfbSendRectEncodingRRE(cl, x, y, w, h)) {
++ REGION_UNINIT(pScreen,&updateRegion);
+ return FALSE;
++ }
+ break;
+ case rfbEncodingCoRRE:
+- if (!rfbSendRectEncodingCoRRE(cl, x, y, w, h))
++ if (!rfbSendRectEncodingCoRRE(cl, x, y, w, h)) {
++ REGION_UNINIT(pScreen,&updateRegion);
++ }
+ return FALSE;
+ break;
+ case rfbEncodingHextile:
+- if (!rfbSendRectEncodingHextile(cl, x, y, w, h))
++ if (!rfbSendRectEncodingHextile(cl, x, y, w, h)) {
++ REGION_UNINIT(pScreen,&updateRegion);
+ return FALSE;
++ }
+ break;
+ }
+ }
+
++ REGION_UNINIT(pScreen,&updateRegion);
++
+ if (!rfbSendUpdateBuf(cl))
+ return FALSE;
+
+@@ -896,9 +911,9 @@
+ firstInNextBand = thisRect;
+ nrectsInBand = 0;
+
+- while ((REGION_RECTS(reg)[firstInNextBand].y1
+- == REGION_RECTS(reg)[thisRect].y1) &&
+- (nrects > 0))
++ while ((nrects > 0) &&
++ (REGION_RECTS(reg)[firstInNextBand].y1
++ == REGION_RECTS(reg)[thisRect].y1))
+ {
+ firstInNextBand += y_inc;
+ nrects--;