artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9d3ff0b
)
free() with nullptr is OK, but not if the size is unitialized, and the
author
deraadt
<deraadt@openbsd.org>
Sat, 27 Nov 2021 06:14:10 +0000
(06:14 +0000)
committer
deraadt
<deraadt@openbsd.org>
Sat, 27 Nov 2021 06:14:10 +0000
(06:14 +0000)
fail label is reachable before the sizes are known.
sys/arch/powerpc64/dev/kexec.c
patch
|
blob
|
history
diff --git
a/sys/arch/powerpc64/dev/kexec.c
b/sys/arch/powerpc64/dev/kexec.c
index
8673cad
..
bb106c7
100644
(file)
--- a/
sys/arch/powerpc64/dev/kexec.c
+++ b/
sys/arch/powerpc64/dev/kexec.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: kexec.c,v 1.
5 2020/09/02 16:07:31
deraadt Exp $ */
+/* $OpenBSD: kexec.c,v 1.
6 2021/11/27 06:14:10
deraadt Exp $ */
/*
* Copyright (c) 2019-2020 Visa Hankala
@@
-242,8
+242,10
@@
fail:
km_free(symaddr, symsize, &kv_any, &kp_kexec);
if (addr)
km_free(addr, size, &kv_any, &kp_kexec);
- free(sh, M_TEMP, shsize);
- free(ph, M_TEMP, phsize);
+ if (sh)
+ free(sh, M_TEMP, shsize);
+ if (ph)
+ free(ph, M_TEMP, phsize);
return error;
}