summaryrefslogtreecommitdiffstats
path: root/libvncclient
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2009-06-16 23:35:12 +0200
committerJohannes Schindelin <johannes.schindelin@gmx.de>2009-06-16 23:35:12 +0200
commitef33182694992202ac3ac987dc12c5c6272e798e (patch)
treeba6448320b2e9e96eaaa4c1c1bfc109c8f4e4772 /libvncclient
parentd11b2abd8cf4d9afb1257695f8be1125d5625a65 (diff)
downloadlibtdevnc-ef33182694992202ac3ac987dc12c5c6272e798e.tar.gz
libtdevnc-ef33182694992202ac3ac987dc12c5c6272e798e.zip
Fix two issues in rfbGetClient()
There was an unnecessary assignment, and an assignment of a string that was to be free()ed later, so it has to be strdup()ed. Both issues spotted by Roman Held. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Diffstat (limited to 'libvncclient')
-rw-r--r--libvncclient/vncviewer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libvncclient/vncviewer.c b/libvncclient/vncviewer.c
index 752f0a7..a5f2f89 100644
--- a/libvncclient/vncviewer.c
+++ b/libvncclient/vncviewer.c
@@ -111,10 +111,9 @@ rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel,
return NULL;
}
initAppData(&client->appData);
- client->programName = NULL;
client->endianTest = 1;
client->programName="";
- client->serverHost="";
+ client->serverHost=strdup("");
client->serverPort=5900;
client->CurrentKeyboardLedState = 0;
@@ -265,6 +264,9 @@ rfbBool rfbInitClient(rfbClient* client,int* argc,char** argv) {
} else {
char* colon=strchr(argv[i],':');
+ if(client->serverHost)
+ free(client->serverHost);
+
if(colon) {
client->serverHost=strdup(argv[i]);
client->serverHost[(int)(colon-argv[i])]='\0';