From 6564c1b942bd3e8396557efd46303277020f2d1c Mon Sep 17 00:00:00 2001 From: Christoph Niethammer Date: Tue, 21 Jul 2020 19:41:37 +0200 Subject: [PATCH] Fix memory leak in configure, which prevents leak sanitizer usage If building Open MPI with sanitizers, e.g $ configure CC=clang CFLAGS=-fsanitize=address .... configure test programs are also build with the sanitizers and will report errors resulting in configure to fail. Signed-off-by: Christoph Niethammer --- config/c_get_alignment.m4 | 1 + 1 file changed, 1 insertion(+) diff --git a/config/c_get_alignment.m4 b/config/c_get_alignment.m4 index 4ec7bf7c1b3..a300cc3d1a3 100644 --- a/config/c_get_alignment.m4 +++ b/config/c_get_alignment.m4 @@ -44,6 +44,7 @@ AC_DEFUN([OPAL_C_GET_ALIGNMENT],[ FILE *f=fopen("conftestval", "w"); if (!f) exit(1); diff = ((char *)&p->x) - ((char *)&p->c); + free(p); fprintf(f, "%d\n", (diff >= 0) ? diff : -diff); ]])], [AS_TR_SH([opal_cv_c_align_$1])=`cat conftestval`], [AC_MSG_WARN([*** Problem running configure test!])