summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-01-08 09:31:28 +1100
committerNeilBrown <neilb@suse.de>2009-01-08 09:31:28 +1100
commit78fbcc10312649f2f4f88283e3f19dce9b205733 (patch)
treedb2596ad62db5b86e1e08a693eb4b5dad2b57d30
parent45b662b611a6fbbdd018a65b6f205e91df884c37 (diff)
parent1a0ee0baf049809f9e67d60bb8158801eada3bd5 (diff)
downloadmdadm-78fbcc10312649f2f4f88283e3f19dce9b205733.tar.gz
mdadm-78fbcc10312649f2f4f88283e3f19dce9b205733.tar.xz
mdadm-78fbcc10312649f2f4f88283e3f19dce9b205733.zip
Merge branch 'master' into scratch-3.0
Conflicts: Assemble.c config.c
-rw-r--r--Monitor.c2
-rw-r--r--config.c2
-rw-r--r--mapfile.c1
-rw-r--r--mdadm.c2
-rw-r--r--mdadm.h11
5 files changed, 16 insertions, 2 deletions
diff --git a/Monitor.c b/Monitor.c
index 240b8db..cbc5d0f 100644
--- a/Monitor.c
+++ b/Monitor.c
@@ -626,7 +626,7 @@ int Wait(char *dev)
free_mdstat(ms);
return rv;
}
- free(ms);
+ free_mdstat(ms);
rv = 0;
mdstat_wait(5);
}
diff --git a/config.c b/config.c
index 6ab5a34..7e09b5c 100644
--- a/config.c
+++ b/config.c
@@ -600,7 +600,7 @@ void mailfromline(char *line)
else {
char *t = NULL;
- if (asprintf(&t, "%s %s", alert_mail_from, w) > 0) {
+ if (xasprintf(&t, "%s %s", alert_mail_from, w) > 0) {
free(alert_mail_from);
alert_mail_from = t;
}
diff --git a/mapfile.c b/mapfile.c
index 75095ec..ca7072e 100644
--- a/mapfile.c
+++ b/mapfile.c
@@ -337,4 +337,5 @@ void RebuildMap(void)
sysfs_uevent(sra, "change");
sysfs_free(sra);
}
+ free_mdstat(mdstat);
}
diff --git a/mdadm.c b/mdadm.c
index a0d6097..1f9b707 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -1241,6 +1241,7 @@ int main(int argc, char *argv[])
rv |= WaitClean(name, v);
put_md_name(name);
}
+ free_mdstat(ms);
} else if (devmode == 'S' && scan) {
/* apply --stop to all devices in /proc/mdstat */
/* Due to possible stacking of devices, repeat until
@@ -1273,6 +1274,7 @@ int main(int argc, char *argv[])
put_md_name(name);
}
+ free_mdstat(ms);
} while (!last && err);
if (err) rv |= 1;
} else {
diff --git a/mdadm.h b/mdadm.h
index e75648b..8220535 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -880,6 +880,17 @@ static inline int is_subarray(char *vers)
#define dprintf(fmt, arg...) \
({ if (0) fprintf(stderr, fmt, ##arg); 0; })
#endif
+#include <assert.h>
+#include <stdarg.h>
+static inline int xasprintf(char **strp, const char *fmt, ...) {
+ va_list ap;
+ int ret;
+ va_start(ap, fmt);
+ ret = asprintf(strp, fmt, ap);
+ va_end(ap);
+ assert(ret >= 0);
+ return ret;
+}
#define LEVEL_MULTIPATH (-4)
#define LEVEL_LINEAR (-1)