summaryrefslogtreecommitdiffstats
path: root/mdadm.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-10 08:48:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-10 08:48:38 +0000
commit14bcae1344091400e419fd9896024a290792ee41 (patch)
tree0cf1088a2fe200cf13cadfadb0da1d10401bfd76 /mdadm.c
parentReleasing debian version 4.2+20230508-7. (diff)
downloadmdadm-14bcae1344091400e419fd9896024a290792ee41.tar.xz
mdadm-14bcae1344091400e419fd9896024a290792ee41.zip
Merging upstream version 4.2+20230901.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mdadm.c')
-rw-r--r--mdadm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/mdadm.c b/mdadm.c
index 076b45e..22d1c53 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -1340,8 +1340,7 @@ int main(int argc, char *argv[])
if (c.homehost == NULL && c.require_homehost)
c.homehost = conf_get_homehost(&c.require_homehost);
if (c.homehost == NULL || strcasecmp(c.homehost, "<system>") == 0) {
- if (gethostname(sys_hostname, sizeof(sys_hostname)) == 0) {
- sys_hostname[sizeof(sys_hostname)-1] = 0;
+ if (s_gethostname(sys_hostname, sizeof(sys_hostname)) == 0) {
c.homehost = sys_hostname;
}
}
@@ -1709,6 +1708,10 @@ int main(int argc, char *argv[])
autodetect();
break;
}
+ if (ss) {
+ ss->ss->free_super(ss);
+ free(ss);
+ }
if (locked)
cluster_release_dlmlock();
close_fd(&mdfd);