From 113853220d5d99720c448c76474c91fc283ea4e5 Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Wed, 29 Dec 2010 16:56:33 -0700 Subject: fix a null pointer dereference in create_stdin (found with cppcheck) --- src/uzbl-core.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/uzbl-core.c b/src/uzbl-core.c index 34cf364..039c520 100644 --- a/src/uzbl-core.c +++ b/src/uzbl-core.c @@ -1687,21 +1687,16 @@ control_stdin(GIOChannel *gio, GIOCondition condition) { void create_stdin () { - GIOChannel *chan = NULL; - GError *error = NULL; - - chan = g_io_channel_unix_new(fileno(stdin)); + GIOChannel *chan = g_io_channel_unix_new(fileno(stdin)); if (chan) { if (!g_io_add_watch(chan, G_IO_IN|G_IO_HUP, (GIOFunc) control_stdin, NULL)) { - g_error ("Stdin: could not add watch\n"); - } else { - if (uzbl.state.verbose) - printf ("Stdin: watch added successfully\n"); + g_error ("create_stdin: could not add watch\n"); + } else if (uzbl.state.verbose) { + printf ("create_stdin: watch added successfully\n"); } } else { - g_error ("Stdin: Error while opening: %s\n", error->message); + g_error ("create_stdin: error while opening stdin\n"); } - if (error) g_error_free (error); } gboolean -- cgit v1.2.3