summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-12-17 11:13:55 -0200
committerRenato Botelho <renato@netgate.com>2015-12-17 11:13:55 -0200
commit02eb529700650bb0a6247479d6c83d206e0a5985 (patch)
treef2dd3e19d51cd578d33f2c231100e5248a937ad2 /sbin
parent4e66c4599e6123e69ca54036271685a3dde9a929 (diff)
parent5952006acb1f0577732ac15f481976227292807f (diff)
downloadFreeBSD-src-02eb529700650bb0a6247479d6c83d206e0a5985.zip
FreeBSD-src-02eb529700650bb0a6247479d6c83d206e0a5985.tar.gz
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'sbin')
-rw-r--r--sbin/geom/class/multipath/geom_multipath.c11
-rw-r--r--sbin/pfctl/pfctl.c1
-rw-r--r--sbin/swapon/swapon.c1
3 files changed, 8 insertions, 5 deletions
diff --git a/sbin/geom/class/multipath/geom_multipath.c b/sbin/geom/class/multipath/geom_multipath.c
index cdf35d0..5743911 100644
--- a/sbin/geom/class/multipath/geom_multipath.c
+++ b/sbin/geom/class/multipath/geom_multipath.c
@@ -221,17 +221,15 @@ mp_label(struct gctl_req *req)
/*
* Allocate a sector to write as metadata.
*/
- sector = malloc(secsize);
+ sector = calloc(1, secsize);
if (sector == NULL) {
gctl_error(req, "unable to allocate metadata buffer");
return;
}
- memset(sector, 0, secsize);
rsector = malloc(secsize);
if (rsector == NULL) {
- free(sector);
gctl_error(req, "unable to allocate metadata buffer");
- return;
+ goto done;
}
/*
@@ -246,7 +244,7 @@ mp_label(struct gctl_req *req)
error = g_metadata_store(name, sector, secsize);
if (error != 0) {
gctl_error(req, "cannot store metadata on %s: %s.", name, strerror(error));
- return;
+ goto done;
}
/*
@@ -274,6 +272,9 @@ mp_label(struct gctl_req *req)
name2, name);
}
}
+done:
+ free(rsector);
+ free(sector);
}
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index 6fd5020..d606b62b 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1873,6 +1873,7 @@ pfctl_set_debug(struct pfctl *pf, char *d)
}
pf->debug_set = 1;
+ level = pf->debug;
if ((pf->opts & PF_OPT_NOACTION) == 0)
if (ioctl(dev, DIOCSETDEBUG, &level))
diff --git a/sbin/swapon/swapon.c b/sbin/swapon/swapon.c
index 033c40a..6351053 100644
--- a/sbin/swapon/swapon.c
+++ b/sbin/swapon/swapon.c
@@ -640,6 +640,7 @@ run_cmd(int *ofd, const char *cmdline, ...)
rv = vasprintf(&cmd, cmdline, ap);
if (rv == -1) {
warn("%s", __func__);
+ va_end(ap);
return (rv);
}
va_end(ap);
OpenPOWER on IntegriCloud