Changeset a0d97f83 in mainline for uspace/srv/net/dnsrsrv/dns_msg.c


Ignore:
Timestamp:
2013-05-03T08:44:14Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ef904895
Parents:
48171fc4
Message:

Fix message allocation/deallocation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/dnsrsrv/dns_msg.c

    r48171fc4 ra0d97f83  
    517517        int rc;
    518518
    519         msg = calloc(1, sizeof(dns_message_t));
     519        msg = dns_message_new();
    520520        if (msg == NULL)
    521521                return ENOMEM;
     
    537537            hdr->opbits);
    538538
    539         list_initialize(&msg->question);
    540         list_initialize(&msg->answer);
    541         list_initialize(&msg->authority);
    542         list_initialize(&msg->additional);
    543 
    544539        doff = sizeof(dns_header_t);
    545540
     
    599594}
    600595
     596dns_message_t *dns_message_new(void)
     597{
     598        dns_message_t *msg;
     599
     600        msg = calloc(1, sizeof(dns_message_t));
     601        if (msg == NULL)
     602                return NULL;
     603
     604        list_initialize(&msg->question);
     605        list_initialize(&msg->answer);
     606        list_initialize(&msg->authority);
     607        list_initialize(&msg->additional);
     608
     609        return msg;
     610}
     611
    601612void dns_message_destroy(dns_message_t *msg)
    602613{
Note: See TracChangeset for help on using the changeset viewer.