Navigation


Changeset 730:e21d79595045 in freeDiameter


Ignore:
Timestamp:
Feb 24, 2011, 5:19:42 PM (10 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

minor improvements

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/cnxctx.c

    r711 r730  
    108108        CHECK_PARAMS_DO( ep || family, return NULL );
    109109        CHECK_PARAMS_DO( (! family) || (family == AF_INET) || (family == AF_INET6), return NULL );
     110        CHECK_PARAMS_DO( (! ep) || (ep->ss.ss_family == AF_INET) || (ep->ss.ss_family == AF_INET6), return NULL );
    110111        CHECK_PARAMS_DO( (! ep) || (!family) || (ep->ss.ss_family == family), return NULL );
    111112
  • libfdproto/messages.c

    r720 r730  
    12181218        memcpy(&avp->avp_storage, value, sizeof(union avp_value));
    12191219       
    1220         /* Copy an octetstring if needed. */
     1220        /* Duplicate an octetstring if needed. */
    12211221        if (type == AVP_TYPE_OCTETSTRING) {
    12221222                if (value->os.len) {
    1223                         CHECK_MALLOC(  avp->avp_storage.os.data = malloc(value->os.len)  );
     1223                        CHECK_MALLOC(  avp->avp_storage.os.data = os0dup(value->os.data, value->os.len)  );
    12241224                        avp->avp_mustfreeos = 1;
    1225                         memcpy(avp->avp_storage.os.data, value->os.data, value->os.len);
    12261225                } else {
    12271226                        avp->avp_storage.os.data = NULL;
  • libfdproto/ostr.c

    r719 r730  
    4141#endif /* !defined(DIAMID_IDNA_IGNORE) && !defined(DIAMID_IDNA_REJECT) */
    4242
    43 /* Similar to strdup with (must be verified) os0_t */
     43/* Similar to strdup with (must have been verified) os0_t */
    4444os0_t os0dup_int(os0_t s, size_t l) {
    4545        os0_t r;
    46         CHECK_MALLOC_DO( r = calloc(l+1, 1), return NULL );
     46        CHECK_MALLOC_DO( r = malloc(l+1), return NULL );
    4747        memcpy(r, s, l); /* this might be faster than a strcpy or strdup because it can work with 32 or 64b blocks */
     48        r[l] = '\0';
    4849        return r;
    4950}
Note: See TracChangeset for help on using the changeset viewer.