summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Ferrandis <ludovic.ferrandis@intel.com>2013-07-01 15:23:36 +0200
committerLudovic Ferrandis <ludovic.ferrandis@intel.com>2013-07-01 15:23:36 +0200
commit4652933e4bfce7fb624abab6c0c9465cef3b6a89 (patch)
tree19b0169bef24bb022ae059c41f3a6dd1a395e5ec
parentcf93ccd162e1954dd87d4351ab42f5627393a443 (diff)
downloaddleyna-renderer-4652933e4bfce7fb624abab6c0c9465cef3b6a89.tar.gz
[Klockwork] NULL pointer may be dereferenced. (#24)
Fix issue #24: ip_address may be NULL and may be dereferenced. Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
-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 ee45166..5c10d98 100644
--- a/libdleyna/renderer/upnp.c
+++ b/libdleyna/renderer/upnp.c
@@ -162,12 +162,12 @@ static void prv_server_available_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);