#2455: leak fix
----------------------------------------+--------------------
Reporter: antomL@… | Type: bug
Status: new | Priority: major
Milestone: unspecified | Component: other
Version: git/master | Keywords:
Operating System: Windows Vista 64bit | Blocked By:
Blocking: |
----------------------------------------+--------------------
dudes, you have multiple memory leaks in the code.
here is a fix for one of them.
{{{
diff --git a/lib/framework/configfile.cpp b/lib/framework/configfile.cpp
index 8c31783..e392903 100644
--- a/lib/framework/configfile.cpp
+++ b/lib/framework/configfile.cpp
@@ -231,6 +231,7 @@ static bool registry_save(const char* filename)
size_t w = 0;
size_t bufferSize = 0;
unsigned int i;
+ bool val;
debug(LOG_WZ, "Saving the registry to [directory: %s] %s",
PHYSFS_getRealDir(filename), filename);
for (i = 0; i < ARRAY_SIZE(registry); ++i)
@@ -262,8 +263,9 @@ static bool registry_save(const char* filename)
free(value);
}
}
-
- return saveFile(filename, buffer, w);
+ val = saveFile(filename, buffer, w);
+ free(buffer);
+ return val;
}
void setRegistryFilePath(const char* fileName)
}}}
dudes, CAN YOU PLEASE REVERT #2444? It causes 353 more warnings and is not
needed.
--
Ticket URL: <http://developer.wz2100.net/ticket/2455>
Warzone 2100 Trac <http://developer.wz2100.net/>
The Warzone 2100 Project
_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev