src/resource_id.c
branchsync
changeset 3083 da1eb049cca1
parent 1898 7d6df20bf02c
     1.1 --- a/src/resource_id.c	Sun Oct 21 12:27:22 2018 +0200
     1.2 +++ b/src/resource_id.c	Sun Oct 21 12:31:32 2018 +0200
     1.3 @@ -5,9 +5,22 @@
     1.4  #include "resource_id.h"
     1.5  
     1.6  pEp_rid_list_t* new_rid_node(pEp_resource_id_type type, const char* resource) {
     1.7 +    assert(resource);
     1.8 +    if (!resource)
     1.9 +        return NULL;
    1.10 +
    1.11      pEp_rid_list_t* retval = (pEp_rid_list_t*)calloc(1, sizeof(pEp_rid_list_t));
    1.12 +    assert(retval);
    1.13 +    if (!retval)
    1.14 +        return NULL;
    1.15 +
    1.16      retval->rid_type = type;
    1.17      retval->rid = strdup(resource);
    1.18 +    assert(retval->rid);
    1.19 +    if (!retval->rid) {
    1.20 +        free(retval);
    1.21 +        return NULL;
    1.22 +    }
    1.23      return retval;
    1.24  }
    1.25