]> granicus.if.org Git - zfs/commitdiff
libzfs: Fix missing va_end call on ENOSPC and EDQUOT cases
authorColin Ian King <colin.king@canonical.com>
Fri, 29 Jul 2016 11:40:30 +0000 (12:40 +0100)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 29 Jul 2016 22:34:12 +0000 (15:34 -0700)
The switch statement in function zfs_standard_error_fmt for the
ENOSPC and EDQUOT cases returns immediately and unlike all other
cases in the switch this does not perform the va_end call.

Perform a break which ends up calling va_end rather than returning
immediately.

Found by static analysis with CoverityScan 0.8.5

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4900

lib/libzfs/libzfs_util.c

index 926ed4ed8aa9647980a998e93878585da56450fb..8fe59a0c04ffe0030b8f97e40b4ceb9af85771b9 100644 (file)
@@ -390,7 +390,7 @@ zfs_standard_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...)
        case ENOSPC:
        case EDQUOT:
                zfs_verror(hdl, EZFS_NOSPC, fmt, ap);
-               return (-1);
+               break;
 
        case EEXIST:
                zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,