projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7b50eb2
)
util-lib: make sure more bitmap calls can deal with NULL objects fine
author
Lennart Poettering
<lennart@poettering.net>
Mon, 21 Dec 2015 18:53:15 +0000
(19:53 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Sat, 26 Dec 2015 18:09:10 +0000
(19:09 +0100)
src/basic/bitmap.c
patch
|
blob
|
history
diff --git
a/src/basic/bitmap.c
b/src/basic/bitmap.c
index
95f59e4
..
c8b2427
100644
(file)
--- a/
src/basic/bitmap.c
+++ b/
src/basic/bitmap.c
@@
-140,7
+140,8
@@
bool bitmap_isset(Bitmap *b, unsigned n) {
bool bitmap_isclear(Bitmap *b) {
unsigned i;
- assert(b);
+ if (!b)
+ return true;
for (i = 0; i < b->n_bitmaps; i++)
if (b->bitmaps[i] != 0)
@@
-150,7
+151,9
@@
bool bitmap_isclear(Bitmap *b) {
}
void bitmap_clear(Bitmap *b) {
- assert(b);
+
+ if (!b)
+ return;
b->bitmaps = mfree(b->bitmaps);
b->n_bitmaps = 0;