summaryrefslogtreecommitdiff
path: root/sbin/pfctl
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2014-05-26 20:54:07 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2014-05-26 20:54:07 +0000
commitcc0ac600dfde00a69a997d1a1c227203d2cbe7f7 (patch)
tree520635d213e6256580dc8539b181133fcdfe84dd /sbin/pfctl
parentd0e13ed783e880db3d09196c987aa639983a1450 (diff)
Replace the following logic:
if (nothing to allocate) ptr = malloc(1) else { if ((ptr = malloc(size to allocate)) memcpy(ptr, data to copy, size to allocate) } if (ptr == NULL) OMG ERROR with a saner logic where the NULL pointer check if moved to the actual malloc branch, so that we do not need to malloc a single byte, just to avoid having a NULL pointer. Whoever thought allocating a single byte was a smart idea was obviously not taking his meds. ok beck@ guenther@
Diffstat (limited to 'sbin/pfctl')
0 files changed, 0 insertions, 0 deletions