Changes in uspace/lib/c/generic/dnsr.c [959d2ec:fff7ef4] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/dnsr.c
r959d2ec rfff7ef4 71 71 { 72 72 async_exch_t *exch = dnsr_exchange_begin(); 73 char cname_buf[DNSR_NAME_MAX_SIZE + 1];74 ipc_call_t cnreply;75 size_t act_size;76 73 dnsr_hostinfo_t *info; 77 74 … … 79 76 aid_t req = async_send_0(exch, DNSR_NAME2HOST, &answer); 80 77 sysarg_t retval = async_data_write_start(exch, name, str_size(name)); 81 aid_t cnreq = async_data_read(exch, cname_buf, DNSR_NAME_MAX_SIZE,82 &cnreply);83 78 84 79 dnsr_exchange_end(exch); … … 86 81 if (retval != EOK) { 87 82 async_forget(req); 88 async_forget(cnreq);89 83 return retval; 90 84 } 91 85 92 86 async_wait_for(req, &retval); 93 if (retval != EOK) {94 async_forget(cnreq);95 return EIO;96 }97 98 async_wait_for(cnreq, &retval);99 87 if (retval != EOK) 100 88 return EIO; … … 104 92 return ENOMEM; 105 93 106 act_size = IPC_GET_ARG2(cnreply); 107 assert(act_size <= DNSR_NAME_MAX_SIZE); 108 cname_buf[act_size] = '\0'; 109 110 info->cname = str_dup(cname_buf); 94 info->name = str_dup(name); 111 95 info->addr.ipv4 = IPC_GET_ARG1(answer); 112 96 … … 120 104 return; 121 105 122 free(info-> cname);106 free(info->name); 123 107 free(info); 124 108 }
Note:
See TracChangeset
for help on using the changeset viewer.