Skip to content

Commit 324ed21

Browse files
committed
pj_clear_proj_info(): fix previous commit that could result in free'ing a static string (#4754 / #4755)
1 parent d3406b0 commit 324ed21

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/info.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ void pj_clear_proj_info()
142142
*****************************************************************************/
143143
{
144144
pj_acquire_lock();
145-
free(const_cast<char *>(info.searchpath));
145+
if (info.searchpath != empty)
146+
free(const_cast<char *>(info.searchpath));
146147
info.searchpath = nullptr;
147148
pj_release_lock();
148149
}

0 commit comments

Comments
 (0)