Skip to content

Commit

Permalink
libzfs: Fix missing va_end call on ENOSPC and EDQUOT cases
Browse files Browse the repository at this point in the history
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 retutning
immediately.

Found by static analysis with CoverityScan 0.8.5

Closes openzfs#4900

Signed-off-by: Colin Ian King <[email protected]>
  • Loading branch information
Colin Ian King committed Jul 29, 2016
1 parent f26b4b3 commit f39447c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/libzfs/libzfs_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f39447c

Please sign in to comment.