diff options
author | thiagoftsm <thiagoftsm@gmail.com> | 2019-09-20 11:45:11 +0000 |
---|---|---|
committer | Chris Akritidis <43294513+cakrit@users.noreply.github.com> | 2019-09-20 13:45:11 +0200 |
commit | f555472a8ceb189407b103570be9a28031819d4b (patch) | |
tree | f6033bcc7c9f2c29b0320f360d9e8d95ed228f01 /libnetdata/url | |
parent | 46c4b8809cad6a0dc65d91e54429e8a7a581c5a2 (diff) |
Fix some errors reported by Coverity (#6797)
* coverity_20190905: Fix reported bugs
This commit has fixes for some bugs reported by Coverity in the present day
* coverity_20190905: Fix missing report
FIx a missing report of error
* coverity_20190905: Pipe close
The previous fix had an error that wolud allow a socket continue opened, this commit fixes this
* coverity_20190905: Error pattern
The call of perror would generate a different error report, instead I am using strerror() to keep pattern
* coverity_20190905: Error function
Rewrite the call to error function
* coverity_20190905: Fix missing tests
The previous fix did not have correct tests after to clean the variables
* coverity_20190905: Fix readable
I changed for an else instead a new if, it is more clean this way
* coverity_20190905: remove unecessary test
This commit is removing an unecessary test for a variable that will never be NULL.
* coverity_20190905: Add neccessary NULLL
After to clean the variable, I am setting NULL to variable to avoid clean again
* coverity_20190905: Remove false error
The condition added to fix Coverity was generating false positives, so we are changing to debug
* coverity_20190905: Remove false error
The condition added to fix Coverity was generating false positives, so we are changing to debug
* coverity_20190905: Bring else to avoid error
Bring an else to solve the problem to read a FD not opened
* coverity_20190905: Return
After to analyse the last changes, I decided to return, because they were not necessary
* coverity_20190905: Remove NULL
Remove unecessary set of variable to NULL
Diffstat (limited to 'libnetdata/url')
-rw-r--r-- | libnetdata/url/url.c | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/libnetdata/url/url.c b/libnetdata/url/url.c index 7df9faaf02..d1d5081397 100644 --- a/libnetdata/url/url.c +++ b/libnetdata/url/url.c @@ -44,23 +44,6 @@ char *url_encode(char *str) { } /** - * URL Decode - * - * Returns a url-decoded version of str - * IMPORTANT: be sure to free() the returned string after use - * - * @param str the string that will be decode - * - * @return a pointer for the url decoded. - */ -char *url_decode(char *str) { - size_t size = strlen(str) + 1; - - char *buf = mallocz(size); - return url_decode_r(buf, str, size); -} - -/** * Percentage escape decode * * Decode %XX character or return 0 if cannot |