diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index bb7e76cec..666ba3b62 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -1951,14 +1951,13 @@ bool FurnaceGUI::importLayout(String path) { fclose(f); return false; } - unsigned char* file=new unsigned char[len]; if (fseek(f,0,SEEK_SET)<0) { perror("size error"); lastError=fmt::sprintf("on get size: %s",strerror(errno)); fclose(f); - delete[] file; return false; } + unsigned char* file=new unsigned char[len]; if (fread(file,1,(size_t)len,f)!=(size_t)len) { perror("read error"); lastError=fmt::sprintf("on read: %s",strerror(errno));