Skip to content

Commit

Permalink
High consequence coverity mesages
Browse files Browse the repository at this point in the history
- initializing fd (analogous to htmldocvisitor)
- always good to close file pointers
  • Loading branch information
albert-github committed Jul 2, 2019
1 parent 4a42645 commit 5059d79
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/docbookvisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ DB_VIS_C
popEnabled();
if (!m_hide)
{
FileDef *fd;
FileDef *fd = 0;
if (!op->includeFileName().isEmpty())
{
QFileInfo cfi( op->includeFileName() );
Expand Down
2 changes: 2 additions & 0 deletions src/dotrunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ bool DotRunner::readBoundingBox(const char *fileName,int *width,int *height,bool
if (p) // found PageBoundingBox or /MediaBox string
{
int x,y;
fclose(f);
if (sscanf(p+bblen,"%d %d %d %d",&x,&y,width,height)!=4)
{
//printf("readBoundingBox sscanf fail\n");
Expand All @@ -137,6 +138,7 @@ bool DotRunner::readBoundingBox(const char *fileName,int *width,int *height,bool
}
}
err("Failed to extract bounding box from generated diagram file %s\n",fileName);
fclose(f);
return FALSE;
}

Expand Down
2 changes: 1 addition & 1 deletion src/latexdocvisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ void LatexDocVisitor::visit(DocIncOperator *op)
popEnabled();
if (!m_hide)
{
FileDef *fd;
FileDef *fd = 0;
if (!op->includeFileName().isEmpty())
{
QFileInfo cfi( op->includeFileName() );
Expand Down
2 changes: 1 addition & 1 deletion src/mandocvisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ void ManDocVisitor::visit(DocIncOperator *op)
popEnabled();
if (!m_hide)
{
FileDef *fd;
FileDef *fd = 0;
if (!op->includeFileName().isEmpty())
{
QFileInfo cfi( op->includeFileName() );
Expand Down
2 changes: 1 addition & 1 deletion src/rtfdocvisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ void RTFDocVisitor::visit(DocIncOperator *op)
popEnabled();
if (!m_hide)
{
FileDef *fd;
FileDef *fd = 0;
if (!op->includeFileName().isEmpty())
{
QFileInfo cfi( op->includeFileName() );
Expand Down
2 changes: 1 addition & 1 deletion src/xmldocvisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ void XmlDocVisitor::visit(DocIncOperator *op)
popEnabled();
if (!m_hide)
{
FileDef *fd;
FileDef *fd = 0;
if (!op->includeFileName().isEmpty())
{
QFileInfo cfi( op->includeFileName() );
Expand Down

0 comments on commit 5059d79

Please sign in to comment.