diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2007-03-20 16:44:36 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2007-03-20 16:44:36 (GMT) |
commit | 8f870ddeca261c331016821488adb7af0977fa04 (patch) | |
tree | 83799efc45a16cff72f63cd563a59e4447c91aaa /Source/CPack | |
parent | b5423a02180ffe898e9e5443af5f30f6c31c9aa3 (diff) | |
download | CMake-8f870ddeca261c331016821488adb7af0977fa04.zip CMake-8f870ddeca261c331016821488adb7af0977fa04.tar.gz CMake-8f870ddeca261c331016821488adb7af0977fa04.tar.bz2 |
BUG: fix coverity error, null check after usage fix
Diffstat (limited to 'Source/CPack')
-rw-r--r-- | Source/CPack/cmCPackTarCompressGenerator.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/CPack/cmCPackTarCompressGenerator.cxx b/Source/CPack/cmCPackTarCompressGenerator.cxx index 8192f70..b73e553 100644 --- a/Source/CPack/cmCPackTarCompressGenerator.cxx +++ b/Source/CPack/cmCPackTarCompressGenerator.cxx @@ -225,15 +225,18 @@ int cmCPackTarCompressGenerator::CompressFiles(const char* outFileName, int cmCPackTarCompress_Compress_Output(void* client_data, const char* data, int data_length) { + if(!client_data) + { + return 0; + } cmcompress_stream *cstream = static_cast<cmcompress_stream*>(client_data); cmCPackTarCompress_Data *mydata = static_cast<cmCPackTarCompress_Data*>(cstream->client_data); - mydata->OutputStream->write(data, data_length); - if ( !mydata->OutputStream ) { return 0; } + mydata->OutputStream->write(data, data_length); return data_length; } |