fix 23 continued: fixed list typo. Oops.
authorKrista Grothoff <krista@pep-project.org>
Sun, 17 Jul 2016 11:16:05 +0200
changeset 8931414001528b3
parent 892 f1155b6285aa
child 894 e4d4d4e677a8
fix 23 continued: fixed list typo. Oops.
src/identity_list.c
     1.1 --- a/src/identity_list.c	Sun Jul 17 10:57:58 2016 +0200
     1.2 +++ b/src/identity_list.c	Sun Jul 17 11:16:05 2016 +0200
     1.3 @@ -14,6 +14,7 @@
     1.4          return NULL;
     1.5  
     1.6      id_list->ident = ident;
     1.7 +    id_list->next = NULL;
     1.8  
     1.9      return id_list;
    1.10  }
    1.11 @@ -32,7 +33,7 @@
    1.12      if (id_list == NULL)
    1.13          return NULL;
    1.14  
    1.15 -    identity_list* src_curr = id_list->next;
    1.16 +    identity_list* src_curr = src->next;
    1.17      identity_list** dst_curr_ptr = &id_list->next;
    1.18      
    1.19      while (src_curr) {
    1.20 @@ -44,33 +45,20 @@
    1.21      
    1.22      return id_list;
    1.23      
    1.24 -    
    1.25 -//         assert(src);
    1.26 -//     if (src == NULL)
    1.27 -//         return NULL;
    1.28 -// 
    1.29 -//     stringlist_t *dst = new_stringlist(src->value);
    1.30 -//     if (dst == NULL)
    1.31 -//         return NULL;
    1.32 -// 
    1.33 -//     stringlist_t* src_curr = src->next;
    1.34 -//     stringlist_t** dst_curr_ptr = &dst->next;
    1.35 -//     
    1.36 -//     while (src_curr) {
    1.37 -//         *dst_curr_ptr = new_stringlist(src_curr->value);
    1.38 -//         src_curr = src_curr->next;
    1.39 -//         dst_curr_ptr = &((*dst_curr_ptr)->next);
    1.40 -//     }
    1.41 -// 
    1.42 -//     return dst;
    1.43  }
    1.44  
    1.45  DYNAMIC_API void free_identity_list(identity_list *id_list)
    1.46  {
    1.47 -    if (id_list) {
    1.48 -        free_identity_list(id_list->next);
    1.49 -        free_identity(id_list->ident);
    1.50 -        free(id_list);
    1.51 +    identity_list *curr;
    1.52 +    identity_list *next;
    1.53 +    
    1.54 +    curr = id_list;
    1.55 +    
    1.56 +    while (curr) {
    1.57 +        next = curr->next;
    1.58 +        free_identity(curr->ident);
    1.59 +        free(curr);
    1.60 +        curr = next;
    1.61      }
    1.62  }
    1.63