mirror of
https://git.FreeBSD.org/src.git
synced 2024-11-25 07:49:18 +00:00
libsa: tftp should use calloc
instead of malloc() memset(), use calloc().
This commit is contained in:
parent
f442898fe7
commit
c658866914
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=339993
@ -448,11 +448,10 @@ tftp_open(const char *path, struct open_file *f)
|
||||
if (is_open)
|
||||
return (EBUSY);
|
||||
|
||||
tftpfile = (struct tftp_handle *) malloc(sizeof(*tftpfile));
|
||||
tftpfile = calloc(1, sizeof(*tftpfile));
|
||||
if (!tftpfile)
|
||||
return (ENOMEM);
|
||||
|
||||
memset(tftpfile, 0, sizeof(*tftpfile));
|
||||
tftpfile->tftp_blksize = TFTP_REQUESTED_BLKSIZE;
|
||||
tftpfile->iodesc = io = socktodesc(*(int *) (f->f_devdata));
|
||||
if (io == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user