libsa: memory leak in tftp_open()
tftpfile is allocated just above and needs to be freed. Reviewed by: imp Approved by: re (kib) Differential Revision: https://reviews.freebsd.org/D17058
This commit is contained in:
parent
fc71a66be0
commit
7ee96df3b3
@ -447,8 +447,10 @@ tftp_open(const char *path, struct open_file *f)
|
||||
memset(tftpfile, 0, sizeof(*tftpfile));
|
||||
tftpfile->tftp_blksize = TFTP_REQUESTED_BLKSIZE;
|
||||
tftpfile->iodesc = io = socktodesc(*(int *) (f->f_devdata));
|
||||
if (io == NULL)
|
||||
if (io == NULL) {
|
||||
free(tftpfile);
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
io->destip = servip;
|
||||
tftpfile->off = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user