From: Constantin Kaplinsky Date: Wed, 20 Aug 2008 06:22:28 +0000 (+0000) Subject: Fixed a few more memory leaks. X-Git-Tag: v0.0.90~407 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7bdccd7002fdf82ef9c4b94df132c5ea903e4348;p=tigervnc.git Fixed a few more memory leaks. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2680 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- diff --git a/unix/x0vncserver/x0vncserver.cxx b/unix/x0vncserver/x0vncserver.cxx index baf9fcce..a6bae95b 100644 --- a/unix/x0vncserver/x0vncserver.cxx +++ b/unix/x0vncserver/x0vncserver.cxx @@ -423,8 +423,9 @@ int main(int argc, char** argv) CharArray dpyStr(displayname.getData()); if (!(dpy = XOpenDisplay(dpyStr.buf[0] ? dpyStr.buf : 0))) { + // FIXME: Why not vlog.error(...)? fprintf(stderr,"%s: unable to open display \"%s\"\r\n", - programName, XDisplayName(displayname.getData())); + programName, XDisplayName(dpyStr.buf)); exit(1); } @@ -450,9 +451,11 @@ int main(int argc, char** argv) TcpListener listener((int)rfbport); vlog.info("Listening on port %d", (int)rfbport); - FileTcpFilter fileTcpFilter(hostsFile.getData()); - if (strlen(hostsFile.getData()) != 0) + const char *hostsData = hostsFile.getData(); + FileTcpFilter fileTcpFilter(hostsData); + if (strlen(hostsData) != 0) listener.setFilter(&fileTcpFilter); + delete[] hostsData; PollingScheduler sched((int)pollingCycle, (int)maxProcessorUsage);