diff options
author | jthorn <jthorn@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2003-07-19 17:31:18 +0000 |
---|---|---|
committer | jthorn <jthorn@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2003-07-19 17:31:18 +0000 |
commit | 4bb87216f2674dbf029f33d3afe4ac14cb45f989 (patch) | |
tree | 26ab81cea572b6fc941cd1e6ffb5b15e70b5bf34 /src/util | |
parent | a830c278668cc23af766710bb6ee68351fb831a2 (diff) |
Fix a memory leak in Util_TableCreateFromString():
This routine first tries to create a table (if this fails it returns
an error code). Then it tries to add entries to the table via
Util_TableSetFromString(). If this fails it previously returned
without destroy the table, thus leaking memory. The fix is to
destroy the table before returning the error code.
This fixes bug Cactus/1561.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@3317 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/Table.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/util/Table.c b/src/util/Table.c index 449131c2..0a5a3407 100644 --- a/src/util/Table.c +++ b/src/util/Table.c @@ -1043,6 +1043,7 @@ int Util_TableCreateFromString(const char string[]) const int status = Util_TableSetFromString(handle, string); if (status < 0) { + Util_TableDestroy(handle); return status; /* error setting values in table */ } |