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
@ -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…
x
Reference in New Issue
Block a user