git: boot0cfg: check result of malloc in read_mbr()
Sascha Wildner
swildner at crater.dragonflybsd.org
Thu Dec 24 09:48:06 PST 2015
commit 5f115e3b8fa054dfb6e59af424b0946871ca6cc0
Author: Alexander Kuleshov <kuleshovmail at gmail.com>
Date: Wed Dec 9 00:38:12 2015 +0600
boot0cfg: check result of malloc in read_mbr()
We allocating buffer for MBR in the read_mbr() function. The malloc()
may return NULL, so this patch checks the result of the malloc and
exit with the error if we can't allocate memory.
Besides this we close file descriptor.
Summary of changes:
usr.sbin/boot0cfg/boot0cfg.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/5f115e3b8fa054dfb6e59af424b0946871ca6cc0
--
DragonFly BSD source repository
More information about the Commits
mailing list