Added memory leak detection to lzmadec.c.
authorLasse Collin <lasse.collin@tukaani.org>
Wed, 16 Jan 2008 12:47:27 +0000 (14:47 +0200)
committerLasse Collin <lasse.collin@tukaani.org>
Wed, 16 Jan 2008 12:47:27 +0000 (14:47 +0200)
src/lzmadec/lzmadec.c

index f0ae356..10d5cc6 100644 (file)
@@ -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