diff options
author | Marcel Raad <raad@teamviewer.com> | 2017-04-22 22:12:37 +0200 |
---|---|---|
committer | Marcel Raad <raad@teamviewer.com> | 2017-04-22 22:12:37 +0200 |
commit | 4a8cf6c4044a1692b441b64a52d1750a92b798ee (patch) | |
tree | 0b591326975275695a7c539cf707a39267eb8d01 /lib/vauth | |
parent | f761da76f6807f8f5906f3ab59872273e9472fad (diff) | |
download | curl-4a8cf6c4044a1692b441b64a52d1750a92b798ee.tar.gz |
lib: fix maybe-uninitialized warnings
With -Og, GCC complains:
easy.c:628:7: error: ‘mcode’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
../lib/strcase.h:35:29: error: ‘tok_buf’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
vauth/digest.c:208:9: note: ‘tok_buf’ was declared here
../lib/strcase.h:35:29: error: ‘tok_buf’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
vauth/digest.c:566:15: note: ‘tok_buf’ was declared here
Fix this by initializing the variables.
Diffstat (limited to 'lib/vauth')
-rw-r--r-- | lib/vauth/digest.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/vauth/digest.c b/lib/vauth/digest.c index 31d25cfa1..268474c78 100644 --- a/lib/vauth/digest.c +++ b/lib/vauth/digest.c @@ -205,7 +205,7 @@ static CURLcode auth_digest_get_qop_values(const char *options, int *value) { char *tmp; char *token; - char *tok_buf; + char *tok_buf = NULL; /* Initialise the output */ *value = 0; @@ -563,7 +563,7 @@ CURLcode Curl_auth_decode_digest_http_message(const char *chlg, return CURLE_OUT_OF_MEMORY; } else if(strcasecompare(value, "qop")) { - char *tok_buf; + char *tok_buf = NULL; /* Tokenize the list and choose auth if possible, use a temporary clone of the buffer since strtok_r() ruins it */ tmp = strdup(content); |