]> granicus.if.org Git - curl/commitdiff
gopher: remove check for path == NULL
authorDaniel Stenberg <daniel@haxx.se>
Mon, 4 Mar 2019 11:22:51 +0000 (12:22 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 5 Mar 2019 07:01:50 +0000 (08:01 +0100)
Since it can't be NULL and it makes Coverity believe we lack proper NULL
checks. Verified by test 659, landed in commit 15401fa886b.

Pointed out by Coverity CID 1442746.

Assisted-by: Dan Fandrich
Fixes #3617
Closes #3642

lib/gopher.c

index 744d06ad7b667ae1bde2a0866759040440aa5145..b296c62d199db7b8c8a6be038aac7c10498548f9 100644 (file)
@@ -88,7 +88,10 @@ static CURLcode gopher_do(struct connectdata *conn, bool *done)
 
   *done = TRUE; /* unconditionally */
 
-  if(path && query)
+  /* path is guaranteed non-NULL */
+  DEBUGASSERT(path);
+
+  if(query)
     gopherpath = aprintf("%s?%s", path, query);
   else
     gopherpath = strdup(path);