diff options
author | Tim Cooper <tim@buzzhives.com> | 2016-01-19 02:21:06 +0300 |
---|---|---|
committer | Tim Cooper <tim@buzzhives.com> | 2016-01-19 02:21:06 +0300 |
commit | 972b2e8bc900637a99162ee5f84826cbfc2f294e (patch) | |
tree | e9cf3990076b3bc48f91376ad0b40069ae1ae6af | |
parent | 946885b210a1052cd787090796d8067b6df65e6a (diff) | |
parent | 4106a9287eb0c309a98e907859cd8a04da67063c (diff) |
Merge pull request #4 from Underground78/coverity
Fix some errors found with Coverity
-rw-r--r-- | TimXmlRpc.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/TimXmlRpc.cpp b/TimXmlRpc.cpp index 20f2317..2434a0a 100644 --- a/TimXmlRpc.cpp +++ b/TimXmlRpc.cpp @@ -692,7 +692,7 @@ static std::string xmlEncode(const char* s) static bool tmEq(struct tm const& t1, struct tm const& t2) { return t1.tm_sec == t2.tm_sec && t1.tm_min == t2.tm_min && - t1.tm_hour == t2.tm_hour && t1.tm_mday == t1.tm_mday && + t1.tm_hour == t2.tm_hour && t1.tm_mday == t2.tm_mday && t1.tm_mon == t2.tm_mon && t1.tm_year == t2.tm_year; } @@ -1001,7 +1001,7 @@ void XmlRpcValue::timeFromXml(const char* &s) if (sscanf_s(s, "%4d%2d%2dT%2d:%2d:%2d", &t.tm_year,&t.tm_mon,&t.tm_mday,&t.tm_hour,&t.tm_min,&t.tm_sec) != 6) throw XmlRpcException("Bad time value"); - t.tm_isdst = -1; + t.tm_wday = t.tm_yday = t.tm_isdst = -1; t.tm_mon -= 1; _type = TypeDateTime; u.asTime = new struct tm(t); @@ -1118,6 +1118,7 @@ void XmlRpcValue::structFromXml(const char* &s) XmlRpcValue val; val.fromXml(s); if ( ! val.valid()) { + free(name); invalidate(); return; } @@ -1415,8 +1416,6 @@ void XmlRpcImplementation::hadError(const char* function) errmsg += "Talking HTTPS to an HTTP server?"; else if (LastError == ERROR_INTERNET_CANNOT_CONNECT) errmsg += "Failed to connect"; - else if (LastError == ERROR_INTERNET_NAME_NOT_RESOLVED) - errmsg += "Name not resolved"; else if (LastError == ERROR_INTERNET_INVALID_URL) errmsg += "Invalid URL"; else if (LastError == ERROR_INTERNET_NAME_NOT_RESOLVED) @@ -1624,6 +1623,7 @@ RETRY: sprintf(buf, "Low level (HTTP) error: %d %s", HttpErrcode, status_text); errmsg = buf; } + free(status_text); InternetCloseHandle(hHttpFile); free(buf); return false; |