mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 20:35:36 +00:00
fix: coverity warnings (#2229)
* fix: coverity uninitialized member warning Xref: https://scan5.coverity.com/reports.htm\#v48014/p10174/fileInstanceId\=204371746\&defectInstanceId\=52288281\&mergedDefectId\=1494442\&eventId\=52288281-41 * fix: coverity uninitialized member warning Xref: https://scan5.coverity.com/reports.htm\#v48014/p10174/fileInstanceId\=204371746\&defectInstanceId\=52288281\&mergedDefectId\=1494442\&eventId\=52288281-43 * fix: coverity unchecked return value Xref: https://scan5.coverity.com/reports.htm\#v48014/p10174/fileInstanceId\=204371760\&defectInstanceId\=52254984\&mergedDefectId\=1494150 * fix: coverity false nullptr dereference warning Xref: https://scan5.coverity.com/reports.htm\#v48014/p10174/fileInstanceId\=204369613\&defectInstanceId\=52254971\&mergedDefectId\=1493396 * fix: coverity unchecked return value Xref: https://scan5.coverity.com/reports.htm\#v48014/p10174/fileInstanceId\=204369625\&defectInstanceId\=52288288\&mergedDefectId\=1491891
This commit is contained in:
@@ -1530,7 +1530,12 @@ static void gotNewBlocklist(
|
||||
stream.opaque = (voidpf)Z_NULL;
|
||||
stream.next_in = reinterpret_cast<Bytef const*>(std::data(response));
|
||||
stream.avail_in = std::size(response);
|
||||
inflateInit2(&stream, windowBits);
|
||||
if (inflateInit2(&stream, windowBits) != Z_OK)
|
||||
{
|
||||
// If stream init fails, log an error but keep going forward
|
||||
// since the file may be uncompressed anyway.
|
||||
tr_logAddError("inflateInit2 failed: %s", stream.msg ? stream.msg : "unknown");
|
||||
}
|
||||
|
||||
auto filename = tr_strvPath(configDir, "blocklist.tmp.XXXXXX");
|
||||
tr_sys_file_t const fd = tr_sys_file_open_temp(std::data(filename), &error);
|
||||
|
||||
Reference in New Issue
Block a user