Skip to content

Commit

Permalink
hack: fixes leack detected by a autodata
Browse files Browse the repository at this point in the history
valgrind detected the following leack

....

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
  • Loading branch information
vincenzopalazzo committed Jan 27, 2024
1 parent c5c5dbc commit 4f56e8d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lightningd/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,12 +540,14 @@ static void maybe_print(struct logger *log, const struct log_entry *l)
log->log_book->log_files);
}

#ifndef NO_NOTIFICATION
static void maybe_notify_log(struct logger *log,
const struct log_entry *l)
{
if (l->level >= log->print_level)
notify_log(log->log_book->ld, l);
}
#endif

void logv(struct logger *log, enum log_level level,
const struct node_id *node_id,
Expand All @@ -568,8 +570,9 @@ void logv(struct logger *log, enum log_level level,
l->log[i] = '?';

maybe_print(log, l);
#ifndef NO_NOTIFICATION
maybe_notify_log(log, l);

#endif
add_entry(log, &l);

if (call_notifier)
Expand Down

0 comments on commit 4f56e8d

Please sign in to comment.