If compress::decompress returns NULL, we need to clean up the allocated specialized compress_* objects -- but NOT delete the passed-in io_stream*. The problem occurs Installer::installOne, but is corrected by modifying the behavior of compress::decompress and the various specialized decompression classes. Detailed explanation: From Installer::installOne: if ((try_decompress = compress::decompress (pkgfile)) != NULL) { // if we get here, then try_decompress has taken ownership // of pkgfile if ((tarstream = archive::extract (try_decompress)) == NULL) { // error handling stuff delete try_decompress; // since try_decompress owns pkgfile, this cleans // up both try_decompress and pkgfile. return; } // this is success...tarstream now owns try_decompress, // which in turn owns pkgfile. Eventually, tarstream // will be cleaned up along with both try_decompress and // pkgfile. } // however, when the IF statement above fails (returns NULL), then // without my patch the internal decompress object will NOT be // deleted before compress::decompress returns NULL. So, // compress::decompress() needs to delete that object, but since // we need pkgfile to still be valid in order to do the test below, // we have to tell the internal decompress object to relinquish // ownership of pkgfile, and NOT delete it during its own destructor. // That's why the code here in Installer::installOne is not changed, // but rather the fix is contained wholly in compress::decompress // and the specialized decompression classes. else if ((tarstream = archive::extract (pkgfile)) == NULL) { /* Not a compressed tarball, not a plain tarball, give up. */ delete pkgfile; ... -- Chuck