summaryrefslogtreecommitdiffstats
path: root/wsutil/wmem/wmem_map.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--wsutil/wmem/wmem_map.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/wsutil/wmem/wmem_map.c b/wsutil/wmem/wmem_map.c
index ea76f455..047b8457 100644
--- a/wsutil/wmem/wmem_map.c
+++ b/wsutil/wmem/wmem_map.c
@@ -231,8 +231,8 @@ wmem_map_contains(wmem_map_t *map, const void *key)
{
wmem_map_item_t *item;
- /* Make sure we have a table */
- if (map->table == NULL) {
+ /* Make sure we have map and a table */
+ if (map == NULL || map->table == NULL) {
return false;
}
@@ -255,8 +255,8 @@ wmem_map_lookup(wmem_map_t *map, const void *key)
{
wmem_map_item_t *item;
- /* Make sure we have a table */
- if (map->table == NULL) {
+ /* Make sure we have map and a table */
+ if (map == NULL || map->table == NULL) {
return NULL;
}
@@ -279,8 +279,8 @@ wmem_map_lookup_extended(wmem_map_t *map, const void *key, const void **orig_key
{
wmem_map_item_t *item;
- /* Make sure we have a table */
- if (map->table == NULL) {
+ /* Make sure we have map and a table */
+ if (map == NULL || map->table == NULL) {
return false;
}
@@ -310,8 +310,8 @@ wmem_map_remove(wmem_map_t *map, const void *key)
wmem_map_item_t **item, *tmp;
void *value;
- /* Make sure we have a table */
- if (map->table == NULL) {
+ /* Make sure we have map and a table */
+ if (map == NULL || map->table == NULL) {
return NULL;
}
@@ -341,8 +341,8 @@ wmem_map_steal(wmem_map_t *map, const void *key)
{
wmem_map_item_t **item, *tmp;
- /* Make sure we have a table */
- if (map->table == NULL) {
+ /* Make sure we have map and a table */
+ if (map == NULL || map->table == NULL) {
return false;
}
@@ -395,7 +395,7 @@ wmem_map_foreach(wmem_map_t *map, GHFunc foreach_func, void * user_data)
unsigned i;
/* Make sure we have a table */
- if (map->table == NULL) {
+ if (map == NULL || map->table == NULL) {
return;
}
@@ -415,7 +415,7 @@ wmem_map_foreach_remove(wmem_map_t *map, GHRFunc foreach_func, void * user_data)
unsigned i, deleted = 0;
/* Make sure we have a table */
- if (map->table == NULL) {
+ if (map == NULL || map->table == NULL) {
return 0;
}