Changeset dc95342 in mainline for uspace/srv/net/dnsres/dnsres.c


Ignore:
Timestamp:
2013-04-22T06:45:49Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
31e9fe0
Parents:
7262f89
Message:

Memory freeing, error paths.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/dnsres/dnsres.c

    r7262f89 rdc95342  
    6060int main(int argc, char *argv[])
    6161{
    62         dns_host_info_t hinfo;
     62        dns_host_info_t *hinfo;
    6363        char *astr;
    6464        int rc;
     
    6969
    7070        if (rc == EOK) {
    71                 rc = addr_format(&hinfo.addr, &astr);
     71                rc = addr_format(&hinfo->addr, &astr);
    7272                if (rc != EOK) {
     73                        dns_hostinfo_destroy(hinfo);
    7374                        printf("Out of memory\n");
    7475                        return ENOMEM;
    7576                }
    7677
    77                 printf("hostname: %s\n", hinfo.name);
     78                printf("hostname: %s\n", hinfo->name);
    7879                printf("IPv4 address: %s\n", astr);
    7980                free(astr);
     81                dns_hostinfo_destroy(hinfo);
    8082        }
    8183
Note: See TracChangeset for help on using the changeset viewer.