Code

memcachec plugin: prev can't be NULL here
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 23 Apr 2016 09:39:47 +0000 (11:39 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 23 Apr 2016 09:39:47 +0000 (11:39 +0200)
[src/memcachec.c:392] -> [src/memcachec.c:390]: (warning) Either the condition 'prev!=0' is redundant or there is possible null pointer dereference: prev.

src/memcachec.c

index 1e1d42dcae65dd9414cfbf3dda4f7186c3cc3732..629b99bab12dc9fa5290c3cb8bb34e87ef3d7bb5 100644 (file)
@@ -387,7 +387,7 @@ static int cmc_config_add_page (oconfig_item_t *ci) /* {{{ */
     web_page_t *prev;
 
     prev = pages_g;
-    while ((prev != NULL) && (prev->next != NULL))
+    while (prev->next != NULL)
       prev = prev->next;
     prev->next = page;
   }