diff options
author | mav <mav@FreeBSD.org> | 2015-02-25 09:57:05 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2015-02-25 09:57:05 +0000 |
commit | 7b898da3ddc397689392d7623e6c5f348b7f17a6 (patch) | |
tree | 5a9aef7b5400f4f281a69d1002465158416b08e7 /sys/boot/fdt/fdt_loader_cmd.c | |
parent | a3e7eefea307392628d7916abb2a9f6a3235ebc4 (diff) | |
download | FreeBSD-src-7b898da3ddc397689392d7623e6c5f348b7f17a6.zip FreeBSD-src-7b898da3ddc397689392d7623e6c5f348b7f17a6.tar.gz |
Fix potential NULL dereference.
Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 2 weeks
Diffstat (limited to 'sys/boot/fdt/fdt_loader_cmd.c')
-rw-r--r-- | sys/boot/fdt/fdt_loader_cmd.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/boot/fdt/fdt_loader_cmd.c b/sys/boot/fdt/fdt_loader_cmd.c index aff2230..0ce8f15 100644 --- a/sys/boot/fdt/fdt_loader_cmd.c +++ b/sys/boot/fdt/fdt_loader_cmd.c @@ -1299,13 +1299,12 @@ fdt_merge_strings(int argc, char *argv[], int start, char **buffer) sz += argc - start; buf = (char *)malloc(sizeof(char) * sz); - bzero(buf, sizeof(char) * sz); - if (buf == NULL) { sprintf(command_errbuf, "could not allocate space " "for string"); return (1); } + bzero(buf, sizeof(char) * sz); idx = 0; for (i = start, idx = 0; i < argc; i++) { |