* [PATCH] gdbus: Remove not needed NULL pointer checks
@ 2012-11-21 10:21 Szymon Janc
2012-11-21 10:38 ` Johan Hedberg
0 siblings, 1 reply; 2+ messages in thread
From: Szymon Janc @ 2012-11-21 10:21 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
g_strdup returns NULL if argument passed is NULL and there is no need
to double check that.
---
gdbus/watch.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdbus/watch.c b/gdbus/watch.c
index 07feb61..1cd1211 100644
--- a/gdbus/watch.c
+++ b/gdbus/watch.c
@@ -240,8 +240,8 @@ proceed:
data = g_new0(struct filter_data, 1);
data->connection = dbus_connection_ref(connection);
- data->name = name ? g_strdup(name) : NULL;
- data->owner = owner ? g_strdup(owner) : NULL;
+ data->name = g_strdup(name);
+ data->owner = g_strdup(owner);
data->path = g_strdup(path);
data->interface = g_strdup(interface);
data->member = g_strdup(member);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-11-21 10:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-21 10:21 [PATCH] gdbus: Remove not needed NULL pointer checks Szymon Janc
2012-11-21 10:38 ` Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).