Imported Upstream version 0.3.2
[debian/uanytun.git] / src / string_list.c
index f23fcdc..a4f4ab8 100644 (file)
@@ -20,8 +20,9 @@
  *  This file is part of uAnytun.
  *
  *  uAnytun is free software: you can redistribute it and/or modify
  *  This file is part of uAnytun.
  *
  *  uAnytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  uAnytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *
  *  uAnytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -91,8 +92,8 @@ int string_list_add(string_list_t* list, const char* string)
     tmp->next_->next_ = 0;
     tmp->next_->string_ = strdup(string);
     if(!tmp->next_->string_) {
     tmp->next_->next_ = 0;
     tmp->next_->string_ = strdup(string);
     if(!tmp->next_->string_) {
-      free(list->first_);
-      list->first_ = NULL;
+      free(tmp->next_);
+      tmp->next_ = NULL;
       return -2;
     }
   }
       return -2;
     }
   }