summaryrefslogtreecommitdiff
path: root/libdleyna
diff options
context:
space:
mode:
authorLudovic Ferrandis <ludovic.ferrandis@intel.com>2013-07-01 15:24:31 +0200
committerLudovic Ferrandis <ludovic.ferrandis@intel.com>2013-07-01 15:24:31 +0200
commit9bb4952d7c85a71ca4502bf1679ae7b18bd8e623 (patch)
tree3fb0683970c51e620f9fd99253f3a63e78c38dcd /libdleyna
parent4652933e4bfce7fb624abab6c0c9465cef3b6a89 (diff)
downloaddleyna-renderer-9bb4952d7c85a71ca4502bf1679ae7b18bd8e623.tar.gz
[Klockwork] NULL pointer may be dereferenced. (#25)
Fix issue #25: ip_address may be NULL and may be dereferenced. Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
Diffstat (limited to 'libdleyna')
-rw-r--r--libdleyna/renderer/upnp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libdleyna/renderer/upnp.c b/libdleyna/renderer/upnp.c
index 5c10d98..6b7ab90 100644
--- a/libdleyna/renderer/upnp.c
+++ b/libdleyna/renderer/upnp.c
@@ -248,12 +248,12 @@ static void prv_server_unavailable_cb(GUPnPControlPoint *cp,
udn = gupnp_device_info_get_udn((GUPnPDeviceInfo *)proxy);
- if (!udn)
- goto on_error;
-
ip_address = gupnp_context_get_host_ip(
gupnp_control_point_get_context(cp));
+ if (!udn || !ip_address)
+ goto on_error;
+
DLEYNA_LOG_DEBUG("UDN %s", udn);
DLEYNA_LOG_DEBUG("IP Address %s", ip_address);