diff --git a/src/gui/update.cpp b/src/gui/update.cpp index bfeb9ce79..b6d66229f 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -420,8 +420,8 @@ bool CFlashUpdate::checkVersion4Update() hide(); - versionInfo = new CFlashVersionInfo(newVersion); // Memory leak: versionInfo - sprintf(msg, g_Locale->getText(LOCALE_FLASHUPDATE_MSGBOX), versionInfo->getType(true), versionInfo->getVersionString(), versionInfo->getDate(), versionInfo->getTime()); + CFlashVersionInfo versionInfo(newVersion); + sprintf(msg, g_Locale->getText(LOCALE_FLASHUPDATE_MSGBOX), versionInfo.getType(true), versionInfo.getVersionString(), versionInfo.getDate(), versionInfo.getTime()); if (gotImage) { @@ -429,7 +429,6 @@ bool CFlashUpdate::checkVersion4Update() if ((strncmp(PACKAGE_RELEASE_CYCLE, versionInfo->getReleaseCycle(), 2) != 0) && (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_WRONGBASE, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes)) { - delete versionInfo; return false; } #endif @@ -437,12 +436,9 @@ bool CFlashUpdate::checkVersion4Update() if ((fileType != '0' /*Release*/) && (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_EXPERIMENTALIMAGE, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes)) { - delete versionInfo; return false; } } - - delete versionInfo; } else {