summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrunge <runge>2005-05-03 22:37:51 +0000
committerrunge <runge>2005-05-03 22:37:51 +0000
commit1bb36df34ea25a3379b5232154a55e4da489ab60 (patch)
treedbf17e80285abe351d7a8d8ef62d1ee58929931b
parentb0daa444cc2fdda15b8b82497d17f80e7d75f8ad (diff)
downloadlibtdevnc-1bb36df34ea25a3379b5232154a55e4da489ab60.tar.gz
libtdevnc-1bb36df34ea25a3379b5232154a55e4da489ab60.zip
libvncserver/main.c: fix memory leak in rfbDoCopyRect/rfbScheduleCopyRect; configure.ac tweaks.
-rw-r--r--ChangeLog4
-rw-r--r--configure.ac28
-rw-r--r--libvncserver/main.c2
3 files changed, 22 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 90c0cf8..827d780 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-05-03 Karl Runge <runge@karlrunge.com>
+ * libvncserver/main.c: fix leak in rfbDoCopyRect/rfbScheduleCopyRect
+ * configure.ac: guard against empty HAVE_X
+
2005-05-02 Karl Runge <runge@karlrunge.com>
* configure.ac: fatal error for x11vnc package if no X present
* configure.ac: give warnings and info about missing libjpeg/libz
diff --git a/configure.ac b/configure.ac
index 9f2299d..92601e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -137,10 +137,10 @@ fi
AC_SUBST(X_LIBS)
AM_CONDITIONAL(HAVE_X, test $HAVE_X != "false")
-if test "$PACKAGE_NAME" = "x11vnc" -a $HAVE_X = "false"; then
+if test "$PACKAGE_NAME" = "x11vnc" -a "x$HAVE_X" = "xfalse"; then
AC_MSG_ERROR([
==========================================================================
-a working X window system build environment is required to build x11vnc.
+A working X window system build environment is required to build x11vnc.
Make sure any required X development packages are installed. If they are
installed in non-standard locations, one can use the --x-includes=DIR
and --x-libraries=DIR configure options or set the CPPFLAGS and LDFLAGS
@@ -190,11 +190,13 @@ if test "x$with_jpeg" != "xno"; then
if test "$PACKAGE_NAME" = "x11vnc"; then
if test "x$HAVE_JPEGLIB_H" != "xtrue"; then
AC_MSG_WARN([
-libjpeg compression library was not found: this may lead to reduced performance
-especially over slow links. If libjpeg is in a non-standard location
-use --with-jpeg=DIR to indicate the header file is in DIR/include/jpeglib.h
-and the library in DIR/lib/libjpeg.a. A copy of libjpeg may be obtained
-from: ftp://ftp.uu.net/graphics/jpeg/
+==========================================================================
+The libjpeg compression library was not found: this may lead to reduced
+performance, especially over slow links. If libjpeg is in a non-standard
+location use --with-jpeg=DIR to indicate the header file is in
+DIR/include/jpeglib.h and the library in DIR/lib/libjpeg.a. A copy of
+libjpeg may be obtained from: ftp://ftp.uu.net/graphics/jpeg/
+==========================================================================
])
fi
fi
@@ -231,11 +233,13 @@ if test "x$with_zlib" != "xno" -a "x$with_libz" != "xno"; then
if test "$PACKAGE_NAME" = "x11vnc"; then
if test "x$HAVE_ZLIB_H" != "xtrue"; then
AC_MSG_WARN([
-libz compression library was not found: this may lead to reduced performance,
-especially over slow links. If libz is in a non-standard location
-use --with-zlib=DIR to indicate the header file is in DIR/include/zlib.h
-and the library in DIR/lib/libz.a. A copy of libz may be obtained
-from: http://www.gzip.org/zlib/
+==========================================================================
+The libz compression library was not found: this may lead to reduced
+performance, especially over slow links. If libz is in a non-standard
+location use --with-zlib=DIR to indicate the header file is in
+DIR/include/zlib.h and the library in DIR/lib/libz.a. A copy of
+libz may be obtained from: http://www.gzip.org/zlib/
+==========================================================================
])
fi
fi
diff --git a/libvncserver/main.c b/libvncserver/main.c
index 9447bf0..529bf2a 100644
--- a/libvncserver/main.c
+++ b/libvncserver/main.c
@@ -172,12 +172,14 @@ void rfbDoCopyRect(rfbScreenInfoPtr screen,int x1,int y1,int x2,int y2,int dx,in
{
sraRegionPtr region = sraRgnCreateRect(x1,y1,x2,y2);
rfbDoCopyRegion(screen,region,dx,dy);
+ sraRgnDestroy(region);
}
void rfbScheduleCopyRect(rfbScreenInfoPtr screen,int x1,int y1,int x2,int y2,int dx,int dy)
{
sraRegionPtr region = sraRgnCreateRect(x1,y1,x2,y2);
rfbScheduleCopyRegion(screen,region,dx,dy);
+ sraRgnDestroy(region);
}
void rfbMarkRegionAsModified(rfbScreenInfoPtr screen,sraRegionPtr modRegion)