summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-03-04 12:22:51 +0100
committerDaniel Stenberg <daniel@haxx.se>2019-03-04 12:22:51 +0100
commit646c6eb6854b2f1ea134e6cc58fdf6406d4cade1 (patch)
tree7a05b16abc1fd4093e66257e552e1592f41e276f
parent2591a491aa7cc736dc1751b7b1a4502eac5edf9e (diff)
downloadcurl-646c6eb6854b2f1ea134e6cc58fdf6406d4cade1.tar.gz
gopher: remove check for path == NULL
Since it can't be NULL and it makes Coverity believe we lack proper NULL checks. Verified by test 659 coming separately in PR #3641. Pointed out by Coverity CID 1442746. Fixes #3617
-rw-r--r--lib/gopher.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/gopher.c b/lib/gopher.c
index 744d06ad7..2b2683573 100644
--- a/lib/gopher.c
+++ b/lib/gopher.c
@@ -79,6 +79,7 @@ static CURLcode gopher_do(struct connectdata *conn, bool *done)
struct Curl_easy *data = conn->data;
curl_socket_t sockfd = conn->sock[FIRSTSOCKET];
char *gopherpath;
+ /* path is guaranteed non-NULL */
char *path = data->state.up.path;
char *query = data->state.up.query;
char *sel = NULL;
@@ -88,7 +89,7 @@ static CURLcode gopher_do(struct connectdata *conn, bool *done)
*done = TRUE; /* unconditionally */
- if(path && query)
+ if(query)
gopherpath = aprintf("%s?%s", path, query);
else
gopherpath = strdup(path);