Fix #26: ifs added to asserts in identity_list_add and identity_list_dup
authorKrista Grothoff <krista@pep-project.org>
Tue, 12 Jul 2016 16:43:45 +0200
changeset 8498e53eacacca0
parent 848 edd76023d731
child 850 d8da56e8da8b
Fix #26: ifs added to asserts in identity_list_add and identity_list_dup
src/identity_list.c
     1.1 --- a/src/identity_list.c	Tue Jul 12 16:38:43 2016 +0200
     1.2 +++ b/src/identity_list.c	Tue Jul 12 16:43:45 2016 +0200
     1.3 @@ -21,6 +21,8 @@
     1.4  DYNAMIC_API identity_list *identity_list_dup(const identity_list *src)
     1.5  {
     1.6      assert(src);
     1.7 +    if (src == NULL)
     1.8 +        return NULL;
     1.9  
    1.10      pEp_identity *_ident = identity_dup(src->ident);
    1.11      if (_ident == NULL)
    1.12 @@ -53,7 +55,9 @@
    1.13  DYNAMIC_API identity_list *identity_list_add(identity_list *id_list, pEp_identity *ident)
    1.14  {
    1.15      assert(ident);
    1.16 -
    1.17 +    if (ident == NULL)
    1.18 +        return NULL;
    1.19 +    
    1.20      if (id_list == NULL)
    1.21          return new_identity_list(ident);
    1.22