Skip to content

Commit a3ba1b6

Browse files
committed
Fix Coverity defect #1462987
1 parent 584bca5 commit a3ba1b6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/nvc_mount.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,13 +382,13 @@ nvc_driver_mount(struct nvc_context *ctx, const struct nvc_container *cnt, const
382382
if (validate_args(ctx, cnt != NULL && info != NULL) < 0)
383383
return (-1);
384384

385-
if (nsenter(&ctx->err, cnt->mnt_ns, CLONE_NEWNS) < 0)
386-
return (-1);
387-
388385
nmnt = 2 + info->nbins + info->nlibs + info->nlibs32 + info->nipcs + info->ndevs;
389386
mnt = ptr = (const char **)array_new(&ctx->err, nmnt);
390387
if (mnt == NULL)
391-
goto fail;
388+
return (-1);
389+
390+
if (nsenter(&ctx->err, cnt->mnt_ns, CLONE_NEWNS) < 0)
391+
return (-1);
392392

393393
/* Procfs mount */
394394
if ((*ptr++ = mount_procfs(&ctx->err, cnt)) == NULL)

0 commit comments

Comments
 (0)