From fd16e1b4f2b3ebea80d40432a99ad3e73906a6ec Mon Sep 17 00:00:00 2001 From: Giuliano Belinassi Date: Wed, 25 Jan 2023 12:24:05 -0300 Subject: [PATCH] Fix linkage of libunwind and file descriptor leak Previously, libpulp.so.0 were being linked against libunwind, but no function of this library is called inside libpulp. This library also do not have any constructors. Hence, only the tools need to link against this library. Also fix a file descriptor leak in the stack check code. Since it is not used in the package updater, this is not critical. Signed-off-by: Giuliano Belinassi --- common/Makefile.am | 2 -- tools/introspection.c | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/common/Makefile.am b/common/Makefile.am index 3994056b..b062db78 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -24,5 +24,3 @@ noinst_LTLIBRARIES = libcommon.la AM_CFLAGS += -I$(abs_top_srcdir)/include libcommon_la_SOURCES = common.c -libcommon_la_LIBADD = $(LIBUNWIND_LIBS) - diff --git a/tools/introspection.c b/tools/introspection.c index 53f8eb23..8b85fec2 100644 --- a/tools/introspection.c +++ b/tools/introspection.c @@ -2307,6 +2307,7 @@ library_range_detect(pid_t pid, char *library, uintptr_t *range_start, WARN("error parsing /proc/%d/maps: %s", pid, strerror(errno)); free(line); + fclose(fp); if (errno) return errno;