Browse Source

cppcheck issue:

[src/Cedar/Connection.c:1041] -> [src/Cedar/Connection.c:1043]: (warning) Either the condition 's!=0' is redundant or there is possible null pointer dereference: s.
Ilya Shipitsin 9 years ago
parent
commit
29f93371c3
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/Cedar/Connection.c

+ 2 - 2
src/Cedar/Connection.c

@@ -1030,7 +1030,7 @@ void ConnectionSend(CONNECTION *c, UINT64 now)
 	UINT size;
 	SESSION *s;
 	HUB *hub = NULL;
-	bool use_qos;
+	bool use_qos = false;
 	// Validate arguments
 	if (c == NULL)
 	{
@@ -1038,11 +1038,11 @@ void ConnectionSend(CONNECTION *c, UINT64 now)
 	}
 
 	s = c->Session;
-	use_qos = s->QoS;
 
 	if (s != NULL)
 	{
 		hub = s->Hub;
+		use_qos = s->QoS;
 	}
 
 	// Protocol