All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] dbus: Add name_cache argument NULL checks
@ 2016-05-11  9:36 Andrew Zaborowski
  2016-05-11  9:36 ` [PATCH 2/2] dbus: Create dbus->filter and name_cache lazily Andrew Zaborowski
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Andrew Zaborowski @ 2016-05-11  9:36 UTC (permalink / raw)
  To: ell

[-- Attachment #1: Type: text/plain, Size: 874 bytes --]

This is so that _dbus_name_cache_free and _dbus_name_cache_notify can be
called with a null pointer similar to l_free, _dbus_filter_free, etc.
---
 ell/dbus-name-cache.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/ell/dbus-name-cache.c b/ell/dbus-name-cache.c
index 24ca619..0c2e08e 100644
--- a/ell/dbus-name-cache.c
+++ b/ell/dbus-name-cache.c
@@ -100,6 +100,9 @@ static void name_cache_entry_destroy(void *data)
 
 void _dbus_name_cache_free(struct _dbus_name_cache *cache)
 {
+	if (!cache)
+		return;
+
 	if (cache->watch_remove_work)
 		l_idle_remove(cache->watch_remove_work);
 
@@ -172,6 +175,9 @@ void _dbus_name_cache_notify(struct _dbus_name_cache *cache,
 	struct service_watch *watch;
 	bool prev_connected, connected;
 
+	if (!cache)
+		return;
+
 	if (_dbus_parse_unique_name(name, NULL))
 		return;
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-05-11 16:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-11  9:36 [PATCH 1/2] dbus: Add name_cache argument NULL checks Andrew Zaborowski
2016-05-11  9:36 ` [PATCH 2/2] dbus: Create dbus->filter and name_cache lazily Andrew Zaborowski
2016-05-11 15:10   ` Denis Kenzior
2016-05-11  9:36 ` [PATCH 1/2] dbus: Utility to look up UNIX_FDS field in raw header Andrew Zaborowski
2016-05-11 15:13   ` Denis Kenzior
2016-05-11  9:36 ` [PATCH 2/2] dbus: Use blocking socket for Dbus1, adapt IO calls Andrew Zaborowski
2016-05-11 16:07   ` Denis Kenzior
2016-05-11 15:12 ` [PATCH 1/2] dbus: Add name_cache argument NULL checks Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.