libstand: tftp_open() can leak pkt on error

The memory can be leaked if we will have pkt set and will get an error
during tftp_open() processing.

Differential Revision:	https://reviews.freebsd.org/D12202
This commit is contained in:
Toomas Soome 2017-09-12 13:51:18 +00:00
parent b40aaca6dd
commit c7901210fb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=323496

View File

@ -467,6 +467,7 @@ tftp_open(const char *path, struct open_file *f)
if (res) {
free(tftpfile->path);
free(tftpfile->pkt);
free(tftpfile);
return (res);
}