gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnurl] 119/256: http: fix a memory leakage in checkrtsppre


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 119/256: http: fix a memory leakage in checkrtspprefix().
Date: Fri, 06 Oct 2017 19:43:30 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnurl.

commit 3b51fa6285303cb5b01c4bd5be1a544a877475e6
Author: Patrick Monnerat <address@hidden>
AuthorDate: Sat Sep 2 12:40:19 2017 +0100

    http: fix a memory leakage in checkrtspprefix().
---
 lib/http.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/lib/http.c b/lib/http.c
index 3e3313278..cf50a7cac 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -2809,6 +2809,7 @@ static bool
 checkrtspprefix(struct Curl_easy *data,
                 const char *s)
 {
+  bool result = FALSE;
 
 #ifdef CURL_DOES_CONVERSIONS
   /* convert from the network encoding using a scratch area */
@@ -2819,16 +2820,17 @@ checkrtspprefix(struct Curl_easy *data,
   }
   if(CURLE_OK != Curl_convert_from_network(data, scratch, strlen(s)+1)) {
     /* Curl_convert_from_network calls failf if unsuccessful */
-    free(scratch);
-    return FALSE; /* can't return CURLE_foobar so return FALSE */
+    result = FALSE; /* can't return CURLE_foobar so return FALSE */
   }
-  s = scratch;
+  else
+    result = checkprefix("RTSP/", scratch)? TRUE: FALSE;
+  free(scratch);
 #else
   (void)data; /* unused */
+  result = checkprefix("RTSP/", s)? TRUE: FALSE;
 #endif /* CURL_DOES_CONVERSIONS */
-  if(checkprefix("RTSP/", s))
-    return TRUE;
-  return FALSE;
+
+  return result;
 }
 #endif /* CURL_DISABLE_RTSP */
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]