Code

src/liboping.c: Declare a variable at the shortest possible scope.
authorFlorian Forster <ff@octo.it>
Tue, 9 May 2017 06:41:18 +0000 (08:41 +0200)
committerFlorian Forster <ff@octo.it>
Tue, 9 May 2017 06:41:18 +0000 (08:41 +0200)
src/liboping.c

index 5a39633b6eab1d4e4cef7f104d5ae7c045948e5b..8b3ca4da21de250debdd219f444d9094169cba39 100644 (file)
@@ -1141,17 +1141,15 @@ pingobj_t *ping_construct (void)
 void ping_destroy (pingobj_t *obj)
 {
        pinghost_t *current;
-       pinghost_t *next;
 
        if (obj == NULL)
                return;
 
        current = obj->head;
-       next = NULL;
 
        while (current != NULL)
        {
-               next = current->next;
+               pinghost_t *next = current->next;
                ping_free (current);
                current = next;
        }