diff options
| author | 2010-02-17 17:34:51 +0000 | |
|---|---|---|
| committer | 2010-02-17 17:34:51 +0000 | |
| commit | 0023b93dea2a646d642c16f044bdca7bbd59b601 (patch) | |
| tree | 0c023ee9c199d352ceaaf5e7c08665fdbcaeb612 /src/kvilib/file/kvi_fileutils.cpp | |
| parent | refreshed polish translation by Be Mi (diff) | |
| download | KVIrc-0023b93dea2a646d642c16f044bdca7bbd59b601.tar.gz KVIrc-0023b93dea2a646d642c16f044bdca7bbd59b601.tar.bz2 KVIrc-0023b93dea2a646d642c16f044bdca7bbd59b601.zip | |
[KVIrc] (trunk) Code clean-ups.
cppcheck ([0]) found quite a few errors and possible memory leaks.
I've started to fix a few:
- [./src/kvilib/file/kvi_fileutils.cpp:325]: (error) Mismatching allocation and deallocation: buf
- [./src/kvilib/system/kvi_locale.cpp:817]: (possible error) Memory leak: c
- [./src/kvirc/kernel/kvi_app_setup.cpp:709]: (possible error) Memory leak: cfgMainGroup
- [./src/kvirc/kernel/kvi_app_setup.cpp:906]: (possible error) Memory leak: cfgMainGroup
[0] http://sourceforge.net/projects/cppcheck/
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@3983 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/kvilib/file/kvi_fileutils.cpp')
| -rw-r--r-- | src/kvilib/file/kvi_fileutils.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/kvilib/file/kvi_fileutils.cpp b/src/kvilib/file/kvi_fileutils.cpp index aa931abf9..76f04d8af 100644 --- a/src/kvilib/file/kvi_fileutils.cpp +++ b/src/kvilib/file/kvi_fileutils.cpp @@ -322,13 +322,14 @@ namespace KviFileUtils char * buf = new char[f.size() + 1]; if(f.readBlock(buf,f.size()) != ((long int)f.size())) { - delete buf; + delete[] buf; buf = 0; return false; } buf[f.size()] = '\0'; szBuffer = QString::fromUtf8(buf); delete[] buf; + buf = 0; return true; } |
