Fixes for some of clang scan-build detected issues
This commit is contained in:
@@ -546,8 +546,9 @@ struct JnyPass : public Pass {
|
||||
|
||||
std::ostream *f;
|
||||
std::stringstream buf;
|
||||
bool empty = filename.empty();
|
||||
|
||||
if (!filename.empty()) {
|
||||
if (!empty) {
|
||||
rewrite_filename(filename);
|
||||
std::ofstream *ff = new std::ofstream;
|
||||
ff->open(filename.c_str(), std::ofstream::trunc);
|
||||
@@ -565,7 +566,7 @@ struct JnyPass : public Pass {
|
||||
JnyWriter jny_writer(*f, false, connections, attributes, properties);
|
||||
jny_writer.write_metadata(design, 0, invk.str());
|
||||
|
||||
if (!filename.empty()) {
|
||||
if (!empty) {
|
||||
delete f;
|
||||
} else {
|
||||
log("%s", buf.str().c_str());
|
||||
|
||||
Reference in New Issue
Block a user