summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-05-05 17:55:29 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-05-05 17:55:29 +0000
commitfd18cec597d56cb2ad322ba04c5ed1b5516f7df3 (patch)
tree17eac3465453ab06f286bdae2e9288fff7dcc036
parent15892632de70a6ed6a7025a09a11b9e287f8f68c (diff)
Fix possible double free in case of connecting to interrupt psm fails.
-rw-r--r--input/manager.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/input/manager.c b/input/manager.c
index 9f8dcf66..51085279 100644
--- a/input/manager.c
+++ b/input/manager.c
@@ -226,6 +226,9 @@ static void interrupt_connect_cb(GIOChannel *chan, int err, gpointer user_data)
goto failed;
}
+ g_io_channel_close(chan);
+ g_io_channel_unref(chan);
+
extract_hid_record(pr->hid_recs->data, &hidp);
if (pr->pnp_recs)
extract_pnp_record(pr->pnp_recs->data, &hidp);
@@ -261,8 +264,6 @@ failed:
cleanup:
g_io_channel_close(pr->ctrl_channel);
g_io_channel_unref(pr->ctrl_channel);
- g_io_channel_close(chan);
- g_io_channel_unref(chan);
pending_req_free(pr);
if (hidp.rd_data)