X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=lib%2Flibzfs%2Flibzfs_mount.c;h=7810e5d68fafc8276afb79ac701d57079d03010a;hb=9babb37438b58e77bad04e820d5702e15b79e6a6;hp=0668dea36fbac61f11314c84bbdad088f7e438f7;hpb=fb5f0bc83330c8a0236c4d34a23723ac1974971a;p=zfs.git diff --git a/lib/libzfs/libzfs_mount.c b/lib/libzfs/libzfs_mount.c index 0668dea..7810e5d 100644 --- a/lib/libzfs/libzfs_mount.c +++ b/lib/libzfs/libzfs_mount.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -1180,10 +1180,12 @@ zpool_enable_datasets(zpool_handle_t *zhp, const char *mntopts, int flags) /* * And mount all the datasets, keeping track of which ones - * succeeded or failed. By using zfs_alloc(), the good pointer - * will always be non-NULL. + * succeeded or failed. */ - good = zfs_alloc(zhp->zpool_hdl, cb.cb_used * sizeof (int)); + if ((good = zfs_alloc(zhp->zpool_hdl, + cb.cb_used * sizeof (int))) == NULL) + goto out; + ret = 0; for (i = 0; i < cb.cb_used; i++) { if (zfs_mount(cb.cb_datasets[i], mntopts, flags) != 0)