summaryrefslogtreecommitdiff
path: root/net/gnome-nettool/files/patch-src_nettool.c
blob: d8ac21225fdd3fb122f6ddf8bff5784650954802 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
--- src/nettool.c.orig	Tue May 10 18:14:48 2005
+++ src/nettool.c	Sun Apr 23 22:00:13 2006
@@ -24,6 +24,7 @@
 #include <string.h>
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <netinet/in.h>
 #include <signal.h>
 #include <errno.h>
 #include <sys/wait.h>
@@ -315,7 +316,7 @@ netinfo_io_text_buffer_dialog (GIOChanne
 			       GIOCondition condition, gpointer data)
 {
 	gchar *text = NULL;
-	gint len;
+	gsize len;
 	Netinfo *netinfo = (Netinfo *) data;
 
 	g_return_val_if_fail (channel != NULL, FALSE);
@@ -360,6 +361,10 @@ netinfo_io_text_buffer_dialog (GIOChanne
 						 	len, NULL);
 			}
 
+			g_free (text);
+
+			return TRUE;
+
 		} else if (status == G_IO_STATUS_AGAIN) {
 			char buf[1];
 
@@ -371,12 +376,13 @@ netinfo_io_text_buffer_dialog (GIOChanne
 				}
 				g_string_append_c (netinfo->command_output, buf[0]);
 			}
+
+			g_free (text);
+			return TRUE;
 		} else if (status == G_IO_STATUS_EOF) {
 		}
 
 		g_free (text);
-
-		return TRUE;
 	}
 
 	/* The condition is not G_IO_HUP | G_IO_ERR | G_IO_NVAL, so