fix #24: freed _ident in identity_list_dup when new_identity_list fails.
authorKrista Grothoff <krista@pep-project.org>
Wed, 20 Jul 2016 15:09:03 +0200
changeset 91408a0252d82c3
parent 913 a821d0b4e8e6
child 915 72fe8bd4ae5e
fix #24: freed _ident in identity_list_dup when new_identity_list fails.
src/identity_list.c
     1.1 --- a/src/identity_list.c	Tue Jul 19 18:17:50 2016 +0200
     1.2 +++ b/src/identity_list.c	Wed Jul 20 15:09:03 2016 +0200
     1.3 @@ -29,8 +29,10 @@
     1.4          return NULL;
     1.5  
     1.6      identity_list *id_list = new_identity_list(_ident);
     1.7 -    if (id_list == NULL)
     1.8 +    if (id_list == NULL) {
     1.9 +        free_identity(_ident);
    1.10          return NULL;
    1.11 +    }
    1.12  
    1.13      identity_list* src_curr = src->next;
    1.14      identity_list** dst_curr_ptr = &id_list->next;