summary refs log tree commit diff
path: root/libio/Makefile
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2015-08-12 23:51:04 -0700
committerPaul Pluzhnikov <ppluzhnikov@google.com>2015-08-12 23:51:04 -0700
commit63e952d9be87db68f0e4164d4a5760b32e77ebff (patch)
tree652f8bece6a6a04f7618093c9d3dc1b0a398d965 /libio/Makefile
parent8a29509dd9aa179bfe4ef96d49d72f6816ec878f (diff)
downloadglibc-63e952d9be87db68f0e4164d4a5760b32e77ebff.tar.gz
glibc-63e952d9be87db68f0e4164d4a5760b32e77ebff.tar.xz
glibc-63e952d9be87db68f0e4164d4a5760b32e77ebff.zip
Fix BZ #18820 -- fmemopen may leak memory on failure.
Diffstat (limited to 'libio/Makefile')
-rw-r--r--libio/Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/libio/Makefile b/libio/Makefile
index 7b3bcf90fe..604f4196b3 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -148,8 +148,10 @@ CFLAGS-tst_putwc.c = -DOBJPFX=\"$(objpfx)\"
 
 tst_wprintf2-ARGS = "Some Text"
 
+test-fmemopen-ENV = MALLOC_TRACE=$(objpfx)test-fmemopen.mtrace
 tst-fopenloc-ENV = MALLOC_TRACE=$(objpfx)tst-fopenloc.mtrace
 
+generated += test-fmemopen.mtrace test-fmemopen.check
 generated += tst-fopenloc.mtrace tst-fopenloc.check
 
 aux	:= fileops genops stdfiles stdio strops
@@ -164,7 +166,7 @@ shared-only-routines = oldiofopen oldiofdopen oldiofclose oldfileops	\
 		       oldiofsetpos64
 
 ifeq ($(run-built-tests),yes)
-tests-special += $(objpfx)test-freopen.out
+tests-special += $(objpfx)test-freopen.out $(objpfx)test-fmemopen-mem.out
 ifeq (yes,$(build-shared))
 # Run tst-fopenloc-cmp.out and tst-openloc-mem.out only if shared
 # library is enabled since they depend on tst-fopenloc.out.
@@ -184,6 +186,10 @@ $(objpfx)tst-fopenloc-cmp.out: ../iconvdata/testdata/ISO-8859-1..UTF8 \
 	cmp $^ > $@; \
 	$(evaluate-test)
 
+$(objpfx)test-fmemopen-mem.out: $(objpfx)test-fmemopen.out
+	$(common-objpfx)malloc/mtrace $(objpfx)test-fmemopen.mtrace > $@; \
+	$(evaluate-test)
+
 $(objpfx)tst-fopenloc-mem.out: $(objpfx)tst-fopenloc.out
 	$(common-objpfx)malloc/mtrace $(objpfx)tst-fopenloc.mtrace > $@; \
 	$(evaluate-test)