summaryrefslogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-03-13 13:57:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-03-13 13:57:48 +0000
commit88ba137fe8f55ea98a498a297f4512b3859181c1 (patch)
treea98587c13cb6139ac2335756d2d50a997206eaec /util.c
parentAdding upstream version 4.2+20230302. (diff)
downloadmdadm-88ba137fe8f55ea98a498a297f4512b3859181c1.tar.xz
mdadm-88ba137fe8f55ea98a498a297f4512b3859181c1.zip
Adding upstream version 4.2+20230304.upstream/4.2+20230304
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--util.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/util.c b/util.c
index 7fc881b..9f1e1f7 100644
--- a/util.c
+++ b/util.c
@@ -421,14 +421,19 @@ int parse_layout_10(char *layout)
int parse_layout_faulty(char *layout)
{
+ int ln, mode;
+ char *m;
+
if (!layout)
return -1;
+
/* Parse the layout string for 'faulty' */
- int ln = strcspn(layout, "0123456789");
- char *m = xstrdup(layout);
- int mode;
+ ln = strcspn(layout, "0123456789");
+ m = xstrdup(layout);
m[ln] = 0;
mode = map_name(faultylayout, m);
+ free(m);
+
if (mode == UnSet)
return -1;