diff --git a/ogr/ogrsf_frmts/mitab/mitab_tabview.cpp b/ogr/ogrsf_frmts/mitab/mitab_tabview.cpp index ba194d8d054a..466e067165d3 100644 --- a/ogr/ogrsf_frmts/mitab/mitab_tabview.cpp +++ b/ogr/ogrsf_frmts/mitab/mitab_tabview.cpp @@ -190,6 +190,7 @@ int TABView::OpenForRead(const char *pszFname, } CPLFree(m_pszFname); + m_pszFname = nullptr; return -1; } @@ -219,6 +220,7 @@ int TABView::OpenForRead(const char *pszFname, CPLErrorReset(); CPLFree(m_pszFname); + m_pszFname = nullptr; return -1; }