]> git.ozlabs.org Git - ccan/commit - ccan/bitmap/bitmap.h
bitmap: Don't crash if allocation fails in bitmap_alloc0() & friends
authorKirill Smelkov <kirr@nexedi.com>
Mon, 1 Jun 2015 15:10:00 +0000 (18:10 +0300)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 2 Jun 2015 09:58:36 +0000 (19:58 +1000)
commitc38e11b508e52fb2921e67d1123b05d9bef90fd2
tree4d088cb752c6f5ff540e107dbc29fb50c0411927
parentd58e2fd2a63dfea5338a1637f9bb89500ad0406d
bitmap: Don't crash if allocation fails in bitmap_alloc0() & friends

Currently, if allocation fails, inside bitmap_alloc0(), we'll continue
to use bitmap=NULL pointer and pass it to bitmap_zero() which will
SIGSEGV.

Cc: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Kirill Smelkov <kirr@nexedi.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
ccan/bitmap/bitmap.h