aboutsummaryrefslogtreecommitdiff
path: root/src/lzmadec
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2008-01-16 14:47:27 +0200
committerLasse Collin <lasse.collin@tukaani.org>2008-01-16 14:47:27 +0200
commit0b581539311f3712946e81e747839f8fb5f441a7 (patch)
tree70fb0bee9ae71f0d080ce9e6dcc7c9992f88be1d /src/lzmadec
parentAdded lzma_memlimit_count(). (diff)
downloadxz-0b581539311f3712946e81e747839f8fb5f441a7.tar.xz
Added memory leak detection to lzmadec.c.
Diffstat (limited to 'src/lzmadec')
-rw-r--r--src/lzmadec/lzmadec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lzmadec/lzmadec.c b/src/lzmadec/lzmadec.c
index f0ae3568..10d5cc60 100644
--- a/src/lzmadec/lzmadec.c
+++ b/src/lzmadec/lzmadec.c
@@ -484,6 +484,8 @@ main(int argc, char **argv)
exit(ERROR);
}
+ assert(lzma_memlimit_count(mem_limitter) == 0);
+
allocator.opaque = mem_limitter;
strm.allocator = &allocator;
@@ -517,6 +519,7 @@ main(int argc, char **argv)
// Free the memory only when debugging. Freeing wastes some time,
// but allows detecting possible memory leaks with Valgrind.
lzma_end(&strm);
+ assert(lzma_memlimit_count(mem_limitter) == 0);
lzma_memlimit_end(mem_limitter, false);
#endif