Commit 71d30a02 authored by Saurav Babu's avatar Saurav Babu Committed by Slava Monich

src: No need to compare expression against NULL

doc/coding-style.txt M13: Check for pointer being NULL
parent 1960487d
......@@ -587,7 +587,7 @@ static void agent_release(struct connman_agent *agent, const char *interface)
message = dbus_message_new_method_call(agent->owner, agent->path,
interface, "Release");
if (message == NULL) {
if (!message) {
connman_error("Couldn't allocate D-Bus message");
return;
}
......
......@@ -2050,21 +2050,21 @@ static int forward_dns_reply(unsigned char *reply, int reply_len, int protocol,
(char *)reply + offset, eom,
ptr, uncompressed, NS_MAXDNAME,
&uptr);
if (ptr == NULL)
if (!ptr)
goto out;
ptr = uncompress(ntohs(hdr->nscount),
(char *)reply + offset, eom,
ptr, uncompressed, NS_MAXDNAME,
&uptr);
if (ptr == NULL)
if (!ptr)
goto out;
ptr = uncompress(ntohs(hdr->arcount),
(char *)reply + offset, eom,
ptr, uncompressed, NS_MAXDNAME,
&uptr);
if (ptr == NULL)
if (!ptr)
goto out;
/*
......
......@@ -3939,7 +3939,7 @@ void __connman_service_set_active_session(bool enable, GSList *list)
else
active_count--;
while (list != NULL) {
while (list) {
enum connman_service_type type = GPOINTER_TO_INT(list->data);
switch (type) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment