diff options
author | mav <mav@FreeBSD.org> | 2010-07-14 15:14:00 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2010-07-14 15:14:00 +0000 |
commit | 129dba64355ce5bbc31e7e9258752c980c51fabd (patch) | |
tree | aa686b155f9c840f0d368a1b5bce30efcdc8e1a9 /sbin | |
parent | 6cc9a00e92553e95008045af113d896f5b8c075c (diff) | |
download | FreeBSD-src-129dba64355ce5bbc31e7e9258752c980c51fabd.zip FreeBSD-src-129dba64355ce5bbc31e7e9258752c980c51fabd.tar.gz |
Do not bzero() NULL pointer on malloc() error.
Submitted by: Dmitry Luhtionov
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/geom/class/virstor/geom_virstor.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/geom/class/virstor/geom_virstor.c b/sbin/geom/class/virstor/geom_virstor.c index b651555..5630de2 100644 --- a/sbin/geom/class/virstor/geom_virstor.c +++ b/sbin/geom/class/virstor/geom_virstor.c @@ -459,9 +459,9 @@ virstor_label(struct gctl_req *req) strlcpy(md.provider, name, sizeof(md.provider)); } sect = malloc(ssize); - bzero(sect, ssize); if (sect == NULL) err(1, "Cannot allocate sector of %zu bytes", ssize); + bzero(sect, ssize); virstor_metadata_encode(&md, sect); error = my_g_metadata_store(name, sect, ssize); free(sect); |