projects
/
platform
/
upstream
/
xz.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8235e6e
)
Free the allocated memory in lzmadec if debugging is
author
Lasse Collin
<lasse.collin@tukaani.org>
Tue, 15 Jan 2008 15:46:59 +0000
(17:46 +0200)
committer
Lasse Collin
<lasse.collin@tukaani.org>
Tue, 15 Jan 2008 15:46:59 +0000
(17:46 +0200)
enabled. This should make it possible to detect possible
memory leaks with Valgrind.
src/lzmadec/lzmadec.c
patch
|
blob
|
history
diff --git
a/src/lzmadec/lzmadec.c
b/src/lzmadec/lzmadec.c
index
fef4924
..
f0ae356
100644
(file)
--- a/
src/lzmadec/lzmadec.c
+++ b/
src/lzmadec/lzmadec.c
@@
-513,5
+513,12
@@
main(int argc, char **argv)
} while (++optind < argc);
}
+#ifndef NDEBUG
+ // Free the memory only when debugging. Freeing wastes some time,
+ // but allows detecting possible memory leaks with Valgrind.
+ lzma_end(&strm);
+ lzma_memlimit_end(mem_limitter, false);
+#endif
+
return exit_status;
}