From: Maxim Mamontov Date: Wed, 8 Dec 2010 13:20:33 +0000 (+0200) Subject: Исправлена утечка ресурса (файлового дескриптора) при ошибке записи X-Git-Tag: 2.407-rc3~318 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/fca86b001448a88f8cb55ead2320e2280997eada?ds=sidebyside Исправлена утечка ресурса (файлового дескриптора) при ошибке записи статистики в файл --- diff --git a/projects/stargazer/plugins/store/files/file_store.cpp b/projects/stargazer/plugins/store/files/file_store.cpp index 556bf8cf..a49ca977 100644 --- a/projects/stargazer/plugins/store/files/file_store.cpp +++ b/projects/stargazer/plugins/store/files/file_store.cpp @@ -1895,6 +1895,7 @@ if (fprintf(statFile, "-> %02d.%02d.%02d - %02d.%02d.%02d\n", STG_LOCKER lock(&mutex, __FILE__, __LINE__); errorStr = string("fprint failed. Message: '") + strerror(errno) + "'"; printfd(__FILE__, "FILES_STORE::WriteDetailStat - fprintf failed. Message: '%s'\n", strerror(errno)); + fclose(statFile); return -1; } @@ -2214,4 +2215,3 @@ fclose(msgFile); return 0; } //----------------------------------------------------------------------------- - diff --git a/projects/stargazer/plugins/store/files/file_store.h b/projects/stargazer/plugins/store/files/file_store.h index 38fea5e1..cb3abdb3 100644 --- a/projects/stargazer/plugins/store/files/file_store.h +++ b/projects/stargazer/plugins/store/files/file_store.h @@ -202,4 +202,3 @@ private: //----------------------------------------------------------------------------- #endif //FILE_STORE_H -