aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Brendan Taylor <whateley@gmail.com>2010-12-29 16:56:33 -0700
committerGravatar Brendan Taylor <whateley@gmail.com>2010-12-29 16:56:33 -0700
commit113853220d5d99720c448c76474c91fc283ea4e5 (patch)
tree8cf1ff315fb27d84600856f21e16bf853fd25574 /src
parent99252a853e9dd9e0e706d6793e836fb85f65ab5a (diff)
fix a null pointer dereference in create_stdin
(found with cppcheck)
Diffstat (limited to 'src')
-rw-r--r--src/uzbl-core.c15
1 files changed, 5 insertions, 10 deletions
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