Browse Source

Fix resources leak reported by coverity

For unique_ptr, release only set the ownership to null, but don't free the resource behind. On the other hand, reset do. 

Closes Coverity ID 483269
Closes Coverity ID 471974
Closes Coverity ID 471973
newinvert
Lucas Dumont 2 years ago
committed by Jon Evans
parent
commit
13c647ef6f
  1. 2
      common/fp_lib_table.cpp
  2. 2
      eeschema/sch_io/http_lib/sch_io_http_lib.cpp
  3. 2
      eeschema/symbol_lib_table.cpp

2
common/fp_lib_table.cpp

@ -62,7 +62,7 @@ void FP_LIB_TABLE_ROW::SetType( const wxString& aType )
if( PCB_IO_MGR::PCB_FILE_T( -1 ) == type )
type = PCB_IO_MGR::KICAD_SEXP;
plugin.release();
plugin.reset();
}

2
eeschema/sch_io/http_lib/sch_io_http_lib.cpp

@ -344,7 +344,7 @@ void SCH_IO_HTTP_LIB::connect()
m_lastError = m_conn->GetLastError();
// Make sure we release pointer so we are able to query API again next time
m_conn.release();
m_conn.reset();
return;
}

2
eeschema/symbol_lib_table.cpp

@ -73,7 +73,7 @@ void SYMBOL_LIB_TABLE_ROW::SetType( const wxString& aType )
if( type == SCH_IO_MGR::SCH_FILE_UNKNOWN )
type = SCH_IO_MGR::SCH_KICAD;
plugin.release();
plugin.reset();
}

Loading…
Cancel
Save