[gtk-vnc-devel] [patch] using g_strdup()



Hi.

I just pushed this little patch, which makes use of the better
g_strdup() instead of traditional strdup().

Cheers,
-- 
Jonh Wendell
www.bani.com.br

# HG changeset patch
# User Jonh Wendell <wendell bani com br>
# Date 1207237975 10800
# Node ID 976c3dcbd0ee73003a8c31a7020bbc4b2d049702
# Parent  d2f49ba72d0ba6484e727bc4a6b3b7941cf6ac64
Use g_strdup() instead of strdup() in vnc_display_open_host(): It doesn't crash if we pass NULL as argument.

diff -r d2f49ba72d0b -r 976c3dcbd0ee src/vncdisplay.c
--- a/src/vncdisplay.c	Wed Apr 02 17:07:24 2008 -0400
+++ b/src/vncdisplay.c	Thu Apr 03 12:52:55 2008 -0300
@@ -1567,13 +1567,13 @@ gboolean vnc_display_open_host(VncDispla
 	if (obj->priv->gvnc == NULL || gvnc_is_open(obj->priv->gvnc))
 		return FALSE;
 
-	obj->priv->host = strdup(host);
+	obj->priv->host = g_strdup(host);
 	if (!obj->priv->host) {
 		return FALSE;
 	}
-	obj->priv->port = strdup(port);
+	obj->priv->port = g_strdup(port);
 	if (!obj->priv->port) {
-		free(obj->priv->host);
+		g_free(obj->priv->host);
 		obj->priv->host = NULL;
 		return FALSE;
 	}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]