summaryrefslogtreecommitdiff
path: root/libdleyna
diff options
context:
space:
mode:
authorLudovic Ferrandis <ludovic.ferrandis@intel.com>2013-07-01 15:09:57 +0200
committerLudovic Ferrandis <ludovic.ferrandis@intel.com>2013-07-01 15:11:32 +0200
commit288878f3843b239fe01be45ab43a88e6b062acfa (patch)
treeca6808421d2968fb290ec1f6e40d2be54c05cd3a /libdleyna
parente56b7dde57b165a6befb1079925ff7eba0134943 (diff)
downloaddleyna-server-288878f3843b239fe01be45ab43a88e6b062acfa.tar.gz
[Klockwork] NULL pointer may be dereferenced. (#27)
Fix issue #27: 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/server/upnp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libdleyna/server/upnp.c b/libdleyna/server/upnp.c
index 2185663..b06ca14 100644
--- a/libdleyna/server/upnp.c
+++ b/libdleyna/server/upnp.c
@@ -249,12 +249,13 @@ static void prv_server_unavailable_cb(GUPnPControlPoint *cp,
DLEYNA_LOG_DEBUG("Enter");
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);