Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

ipath/ipath_debug: add a destructor for ipath_mylabel #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ipath/ipath_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ FILE *__ipath_dbgout;
static void init_ipath_mylabel(void) __attribute__ ((constructor));
static void init_ipath_backtrace(void) __attribute__ ((constructor));
static void init_ipath_dbgfile(void) __attribute__ ((constructor));
static void fini_ipath_mylabel(void) __attribute__ ((destructor));
static void fini_ipath_backtrace(void) __attribute__ ((destructor));

static void init_ipath_mylabel(void)
Expand Down Expand Up @@ -80,6 +81,12 @@ static void init_ipath_mylabel(void)
__ipath_mylabel = strdup(lbl);
}

static void fini_ipath_mylabel(void)
{
if (NULL != __ipath_mylabel)
free(__ipath_mylabel);
}

static void
ipath_sighdlr(int sig, siginfo_t *p1, void *ucv)
{
Expand Down