Skip to content

Commit

Permalink
don't leak syslog_identifier
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Hunt~ <pehunt@redhat.com>
  • Loading branch information
haircommander committed Nov 3, 2022
1 parent f903e20 commit 28b3bc7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ctr_logging.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,15 @@ void configure_log_drivers(gchar **log_drivers, int64_t log_size_max_, int64_t l
name_len = strlen(name);
container_name = g_strdup_printf("CONTAINER_NAME=%s", name);

g_free(syslog_identifier);
syslog_identifier = g_strdup_printf("SYSLOG_IDENTIFIER=%s", name);
syslog_identifier_len = name_len + SYSLOG_IDENTIFIER_EQ_LEN;
}
if (tag) {
container_tag = g_strdup_printf("CONTAINER_TAG=%s", tag);
container_tag_len = strlen(container_tag);

g_free(syslog_identifier);
syslog_identifier = g_strdup_printf("SYSLOG_IDENTIFIER=%s", tag);
syslog_identifier_len = strlen(syslog_identifier);
}
Expand Down

0 comments on commit 28b3bc7

Please sign in to comment.