Fix CID 1215128: Free the allocated buf when image_set_size()
returns and error and we return from bsd_write().
This commit is contained in:
parent
bce9a24a0e
commit
9746454f54
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=266510
@ -82,8 +82,10 @@ bsd_write(lba_t imgsz, void *bootcode)
|
||||
|
||||
imgsz = ncyls * nheads * nsecs;
|
||||
error = image_set_size(imgsz);
|
||||
if (error)
|
||||
if (error) {
|
||||
free(buf);
|
||||
return (error);
|
||||
}
|
||||
|
||||
d = (void *)(buf + secsz);
|
||||
le32enc(&d->d_magic, DISKMAGIC);
|
||||
|
Loading…
Reference in New Issue
Block a user