Fix memory leak in recv_skip

When the exception branch exits, the buf is leaked.

Reviewed by: Richard Laager <rlaager@wiktel.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: luozhengzheng <luo.zhengzheng@zte.com.cn>
Closes #5262
This commit is contained in:
luozhengzheng 2016-10-12 01:24:18 +08:00 committed by Brian Behlendorf
parent 1697d2dcf1
commit fad5fb01ad
1 changed files with 1 additions and 0 deletions

View File

@ -3025,6 +3025,7 @@ recv_skip(libzfs_handle_t *hdl, int fd, boolean_t byteswap)
default:
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"invalid record type"));
free(buf);
return (zfs_error(hdl, EZFS_BADSTREAM, errbuf));
}
}