From 573b27799ab40669eb27a7d3230b1b4f7095120a Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Tue, 13 Nov 2012 13:52:40 +0100 Subject: [PATCH] network: Fix dead assignment in connect_cb Value stored to err_msg is never read in case err was not NULL. Simply remove err_msg and pass strerror() directly where it is used. --- profiles/network/connection.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/profiles/network/connection.c b/profiles/network/connection.c index abcbee81f..1a1fb4d45 100644 --- a/profiles/network/connection.c +++ b/profiles/network/connection.c @@ -371,19 +371,16 @@ static int bnep_connect(struct network_conn *nc) static void connect_cb(GIOChannel *chan, GError *err, gpointer data) { struct network_conn *nc = data; - const char *err_msg; int perr; if (err) { error("%s", err->message); - err_msg = err->message; goto failed; } perr = bnep_connect(nc); if (perr < 0) { - err_msg = strerror(-perr); - error("bnep connect(): %s (%d)", err_msg, -perr); + error("bnep connect(): %s (%d)", strerror(-perr), -perr); goto failed; } -- 2.47.3