From 708ea308060e3a68b9596a714afa94c56e6bbde4 Mon Sep 17 00:00:00 2001 From: Yoichi NAKAYAMA Date: Sat, 21 Apr 2012 21:48:55 +0900 Subject: [PATCH] Fix condition for allocation failure in get_content_type(). At the end of get_content_type() in webserver.c, it should check return value of ixmlCloneDOMString(). --- ChangeLog | 7 +++++++ upnp/src/genlib/net/http/webserver.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 00d9bb1..167fe6d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,13 @@ Version 1.6.18 ******************************************************************************* +2012-04-21 Yoichi NAKAYAMA + + Fix condition for allocation failure in get_content_type(). + + At the end of get_content_type() in webserver.c, it should check + return value of ixmlCloneDOMString(). + 2012-04-21 Yoichi NAKAYAMA Fix problems detected as dead assignment warning by clang scan-build. diff --git a/upnp/src/genlib/net/http/webserver.c b/upnp/src/genlib/net/http/webserver.c index 50527fc..b2c3eb8 100644 --- a/upnp/src/genlib/net/http/webserver.c +++ b/upnp/src/genlib/net/http/webserver.c @@ -344,7 +344,7 @@ static UPNP_INLINE int get_content_type( } (*content_type) = ixmlCloneDOMString(temp); free(temp); - if (!content_type) + if (!(*content_type)) return UPNP_E_OUTOF_MEMORY; return 0;