Skip to content

Commit

Permalink
Merge pull request #716 from rical/fix-confd-cont-double-free
Browse files Browse the repository at this point in the history
confd: fix double free of container hostname
  • Loading branch information
troglobit authored Oct 16, 2024
2 parents 0e276a9 + 3b4d2b3 commit 08348c4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/confd/src/infix-containers.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,10 @@ static int add(const char *name, struct lyd_node *cif)
if ((string = lydx_get_cattr(cif, "hostname"))) {
char *fmt = (char *)string;

if (hostnamefmt(&confd, &fmt)) {
if (hostnamefmt(&confd, &fmt))
ERRNO("%s: failed setting custom hostname", name);
} else {
else
fprintf(fp, " --hostname %s", fmt);
free(fmt);
}
}

if (lydx_is_enabled(cif, "read-only"))
Expand Down

0 comments on commit 08348c4

Please sign in to comment.