From b20491fbbc1ae8fc7fda1f0486e8b6ff7c2b3e67 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Thu, 21 Apr 2011 09:39:44 +0200 Subject: [PATCH] session: Handle connman_inet_ifname NULL return connman_inet_ifname can return a NULL pointer. For example this happens when all wifi interfaces are being removed because the wifi dongle has been unplugged. The service is still valid at this point but there is no device anymore. The kernel will then correctly return NULL. --- src/session.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/session.c b/src/session.c index 4047102..5cc85c4 100644 --- a/src/session.c +++ b/src/session.c @@ -676,7 +676,8 @@ static void update_info(struct session_info *info) idx = __connman_service_get_index(info->service); info->ifname = connman_inet_ifname(idx); - + if (info->ifname == NULL) + info->ifname = ""; } else { info->bearer = ""; info->online = FALSE; -- 2.7.4