From b67c321869f7eb5402e6053a74caca1cf57dbd66 Mon Sep 17 00:00:00 2001 From: Marcelo Roberto Jimenez Date: Wed, 20 Oct 2010 00:29:08 -0200 Subject: [PATCH] Fix a long date memory leak in webserver.c:StrStr(). (cherry picked from commit bf1450bf81f2a98d89950db0df84e5ae9e99b824) --- ChangeLog | 4 ++++ upnp/src/genlib/net/http/webserver.c | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 783cb66..cb07d11 100644 --- a/ChangeLog +++ b/ChangeLog @@ -221,6 +221,10 @@ Version 1.8.0 Version 1.6.8 ******************************************************************************* +2010-10-20 Marcelo Roberto Jimenez + + Fix a long date memory leak in webserver.c:StrStr(). + 2010-10-19 Marcelo Roberto Jimenez Bug fix in select of miniserver.c diff --git a/upnp/src/genlib/net/http/webserver.c b/upnp/src/genlib/net/http/webserver.c index 1a1ea90..76ad06e 100644 --- a/upnp/src/genlib/net/http/webserver.c +++ b/upnp/src/genlib/net/http/webserver.c @@ -824,12 +824,12 @@ StrStr( char *S1, ToUpperCase( Str1 ); ToUpperCase( Str2 ); Ptr = strstr( Str1, Str2 ); - if( Ptr == NULL ) - return NULL; - - Pos = Ptr - Str1; - - Ret = S1 + Pos; + if( Ptr == NULL ) { + Ret = NULL; + } else { + Pos = Ptr - Str1; + Ret = S1 + Pos; + } free( Str1 ); free( Str2 );