Update copyright notices.
[liboping.git] / src / liboping.c
index de82d5f..eca5c16 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * Object oriented C module to send ICMP and ICMPv6 `echo's.
- * Copyright (C) 2006-2016  Florian octo Forster <ff at octo.it>
+ * Copyright (C) 2006-2017  Florian octo Forster <ff at octo.it>
  *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published by the
@@ -1123,9 +1123,9 @@ pingobj_t *ping_construct (void)
 {
        pingobj_t *obj;
 
-       if ((obj = (pingobj_t *) malloc (sizeof (pingobj_t))) == NULL)
+       if ((obj = malloc (sizeof (*obj))) == NULL)
                return (NULL);
-       memset (obj, 0, sizeof (pingobj_t));
+       memset (obj, 0, sizeof (*obj));
 
        obj->timeout    = PING_DEF_TIMEOUT;
        obj->ttl        = PING_DEF_TTL;
@@ -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;
        }