artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
42cd308
)
Imitate how free(3) behaves and make map_clear() works on NULL map.
author
mpi
<mpi@openbsd.org>
Wed, 1 Sep 2021 08:06:49 +0000
(08:06 +0000)
committer
mpi
<mpi@openbsd.org>
Wed, 1 Sep 2021 08:06:49 +0000
(08:06 +0000)
usr.sbin/btrace/map.c
patch
|
blob
|
history
diff --git
a/usr.sbin/btrace/map.c
b/usr.sbin/btrace/map.c
index
b5bb8fb
..
5624db6
100644
(file)
--- a/
usr.sbin/btrace/map.c
+++ b/
usr.sbin/btrace/map.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: map.c,v 1.1
5 2021/09/01 07:35:21
mpi Exp $ */
+/* $OpenBSD: map.c,v 1.1
6 2021/09/01 08:06:49
mpi Exp $ */
/*
* Copyright (c) 2020 Martin Pieuchot <mpi@openbsd.org>
@@
-84,6
+84,9
@@
map_clear(struct map *map)
{
struct mentry *mep;
+ if (map == NULL)
+ return;
+
while ((mep = RB_MIN(map, map)) != NULL) {
RB_REMOVE(map, map, mep);
free(mep);