# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: petr.koupy@gmail.com-20110328003358-figohl0siqh1j288
# target_branch: bzr://bzr.helenos.org/mainline
# testament_sha1: 75d9dab3c202f95b9a28b5a3c742cd8ba14a6e8f
# timestamp: 2011-03-28 02:36:28 +0200
# base_revision_id: jakub@jermar.eu-20110326152906-4nqf7cc7vwgs62cc
#
# Begin patch
=== modified file 'uspace/lib/c/generic/net/packet.c'
|
|
|
|
| 189 | 189 | munmap(packet, packet->length); |
| 190 | 190 | } |
| 191 | 191 | } |
| 192 | | gpm_destroy(&pm_globals.packet_map); |
| | 192 | gpm_destroy(&pm_globals.packet_map, free); |
| 193 | 193 | /* leave locked */ |
| 194 | 194 | } |
| 195 | 195 | |
=== modified file 'uspace/lib/c/generic/net/socket_client.c'
|
|
|
|
| 748 | 748 | |
| 749 | 749 | dyn_fifo_destroy(&socket->received); |
| 750 | 750 | dyn_fifo_destroy(&socket->accepted); |
| 751 | | sockets_exclude(socket_get_sockets(), socket->socket_id); |
| | 751 | sockets_exclude(socket_get_sockets(), socket->socket_id, free); |
| 752 | 752 | } |
| 753 | 753 | |
| 754 | 754 | /** Closes the socket. |
=== modified file 'uspace/lib/c/include/adt/generic_char_map.h'
|
|
|
|
| 46 | 46 | /** Internal magic value for a map consistency check. */ |
| 47 | 47 | #define GENERIC_CHAR_MAP_MAGIC_VALUE 0x12345622 |
| 48 | 48 | |
| | 49 | /** Generic destructor function pointer. */ |
| | 50 | #define DTOR_T(identifier) \ |
| | 51 | void (*identifier)(const void *) |
| | 52 | |
| 49 | 53 | /** Character string to generic type map declaration. |
| 50 | 54 | * @param[in] name Name of the map. |
| 51 | 55 | * @param[in] type Inner object type. |
| … |
… |
|
| 63 | 67 | \ |
| 64 | 68 | int name##_add(name##_t *, const uint8_t *, const size_t, type *); \ |
| 65 | 69 | int name##_count(name##_t *); \ |
| 66 | | void name##_destroy(name##_t *); \ |
| 67 | | void name##_exclude(name##_t *, const uint8_t *, const size_t); \ |
| | 70 | void name##_destroy(name##_t *, DTOR_T()); \ |
| | 71 | void name##_exclude(name##_t *, const uint8_t *, const size_t, DTOR_T()); \ |
| 68 | 72 | type *name##_find(name##_t *, const uint8_t *, const size_t); \ |
| 69 | 73 | int name##_initialize(name##_t *); \ |
| 70 | 74 | int name##_is_valid(name##_t *); |
| … |
… |
|
| 83 | 87 | int name##_add(name##_t *map, const uint8_t *name, const size_t length, \ |
| 84 | 88 | type *value) \ |
| 85 | 89 | { \ |
| 86 | | int rc; \ |
| 87 | 90 | int index; \ |
| 88 | 91 | if (!name##_is_valid(map)) \ |
| 89 | 92 | return EINVAL; \ |
| 90 | 93 | index = name##_items_add(&map->values, value); \ |
| 91 | 94 | if (index < 0) \ |
| 92 | 95 | return index; \ |
| 93 | | rc = char_map_add(&map->names, name, length, index); \ |
| 94 | | if (rc != EOK) { \ |
| 95 | | name##_items_exclude_index(&map->values, index); \ |
| 96 | | return rc; \ |
| 97 | | } \ |
| 98 | | return EOK; \ |
| | 96 | return char_map_add(&map->names, name, length, index); \ |
| 99 | 97 | } \ |
| 100 | 98 | \ |
| 101 | 99 | int name##_count(name##_t *map) \ |
| … |
… |
|
| 104 | 102 | name##_items_count(&map->values) : -1; \ |
| 105 | 103 | } \ |
| 106 | 104 | \ |
| 107 | | void name##_destroy(name##_t *map) \ |
| | 105 | void name##_destroy(name##_t *map, DTOR_T(dtor)) \ |
| 108 | 106 | { \ |
| 109 | 107 | if (name##_is_valid(map)) { \ |
| 110 | 108 | char_map_destroy(&map->names); \ |
| 111 | | name##_items_destroy(&map->values); \ |
| | 109 | name##_items_destroy(&map->values, dtor); \ |
| 112 | 110 | } \ |
| 113 | 111 | } \ |
| 114 | 112 | \ |
| 115 | 113 | void name##_exclude(name##_t *map, const uint8_t *name, \ |
| 116 | | const size_t length) \ |
| | 114 | const size_t length, DTOR_T(dtor)) \ |
| 117 | 115 | { \ |
| 118 | 116 | if (name##_is_valid(map)) { \ |
| 119 | 117 | int index; \ |
| 120 | 118 | index = char_map_exclude(&map->names, name, length); \ |
| 121 | 119 | if (index != CHAR_MAP_NULL) \ |
| 122 | 120 | name##_items_exclude_index(&map->values, \ |
| 123 | | index); \ |
| | 121 | index, dtor); \ |
| 124 | 122 | } \ |
| 125 | 123 | } \ |
| 126 | 124 | \ |
=== modified file 'uspace/lib/c/include/adt/generic_field.h'
|
|
|
|
| 45 | 45 | /** Internal magic value for a field consistency check. */ |
| 46 | 46 | #define GENERIC_FIELD_MAGIC_VALUE 0x55667788 |
| 47 | 47 | |
| | 48 | /** Generic destructor function pointer. */ |
| | 49 | #define DTOR_T(identifier) \ |
| | 50 | void (*identifier)(const void *) |
| | 51 | |
| 48 | 52 | /** Generic type field declaration. |
| 49 | 53 | * |
| 50 | 54 | * @param[in] name Name of the field. |
| … |
… |
|
| 62 | 66 | \ |
| 63 | 67 | int name##_add(name##_t *, type *); \ |
| 64 | 68 | int name##_count(name##_t *); \ |
| 65 | | void name##_destroy(name##_t *); \ |
| 66 | | void name##_exclude_index(name##_t *, int); \ |
| | 69 | void name##_destroy(name##_t *, DTOR_T()); \ |
| | 70 | void name##_exclude_index(name##_t *, int, DTOR_T()); \ |
| 67 | 71 | type **name##_get_field(name##_t *); \ |
| 68 | 72 | type *name##_get_index(name##_t *, int); \ |
| 69 | 73 | int name##_initialize(name##_t *); \ |
| … |
… |
|
| 102 | 106 | return name##_is_valid(field) ? field->next : -1; \ |
| 103 | 107 | } \ |
| 104 | 108 | \ |
| 105 | | void name##_destroy(name##_t *field) \ |
| | 109 | void name##_destroy(name##_t *field, DTOR_T(dtor)) \ |
| 106 | 110 | { \ |
| 107 | 111 | if (name##_is_valid(field)) { \ |
| 108 | 112 | int index; \ |
| 109 | 113 | field->magic = 0; \ |
| 110 | | for (index = 0; index < field->next; index++) { \ |
| 111 | | if (field->items[index]) \ |
| 112 | | free(field->items[index]); \ |
| | 114 | if (dtor) { \ |
| | 115 | for (index = 0; index < field->next; index++) { \ |
| | 116 | if (field->items[index]) \ |
| | 117 | dtor(field->items[index]); \ |
| | 118 | } \ |
| 113 | 119 | } \ |
| 114 | 120 | free(field->items); \ |
| 115 | 121 | } \ |
| 116 | 122 | } \ |
| 117 | 123 | \ |
| 118 | | void name##_exclude_index(name##_t *field, int index) \ |
| | 124 | void name##_exclude_index(name##_t *field, int index, DTOR_T(dtor)) \ |
| 119 | 125 | { \ |
| 120 | 126 | if (name##_is_valid(field) && (index >= 0) && \ |
| 121 | 127 | (index < field->next) && (field->items[index])) { \ |
| 122 | | free(field->items[index]); \ |
| | 128 | if (dtor) \ |
| | 129 | dtor(field->items[index]); \ |
| 123 | 130 | field->items[index] = NULL; \ |
| 124 | 131 | } \ |
| 125 | 132 | } \ |
=== modified file 'uspace/lib/c/include/adt/int_map.h'
|
|
|
|
| 48 | 48 | /** Internal magic value for an item consistency check. */ |
| 49 | 49 | #define INT_MAP_ITEM_MAGIC_VALUE 0x55667788 |
| 50 | 50 | |
| | 51 | /** Generic destructor function pointer. */ |
| | 52 | #define DTOR_T(identifier) \ |
| | 53 | void (*identifier)(const void *) |
| | 54 | |
| 51 | 55 | /** Integer to generic type map declaration. |
| 52 | 56 | * |
| 53 | 57 | * @param[in] name Name of the map. |
| … |
… |
|
| 71 | 75 | }; \ |
| 72 | 76 | \ |
| 73 | 77 | int name##_add(name##_t *, int, type *); \ |
| 74 | | void name##_clear(name##_t *); \ |
| | 78 | void name##_clear(name##_t *, DTOR_T()); \ |
| 75 | 79 | int name##_count(name##_t *); \ |
| 76 | | void name##_destroy(name##_t *); \ |
| 77 | | void name##_exclude(name##_t *, int); \ |
| 78 | | void name##_exclude_index(name##_t *, int); \ |
| | 80 | void name##_destroy(name##_t *, DTOR_T()); \ |
| | 81 | void name##_exclude(name##_t *, int, DTOR_T()); \ |
| | 82 | void name##_exclude_index(name##_t *, int, DTOR_T()); \ |
| 79 | 83 | type *name##_find(name##_t *, int); \ |
| 80 | 84 | int name##_update(name##_t *, int, int); \ |
| 81 | 85 | type *name##_get_index(name##_t *, int); \ |
| 82 | 86 | int name##_initialize(name##_t *); \ |
| 83 | 87 | int name##_is_valid(name##_t *); \ |
| 84 | | void name##_item_destroy(name##_item_t *); \ |
| | 88 | void name##_item_destroy(name##_item_t *, DTOR_T()); \ |
| 85 | 89 | int name##_item_is_valid(name##_item_t *); |
| 86 | 90 | |
| 87 | 91 | /** Integer to generic type map implementation. |
| … |
… |
|
| 114 | 118 | return EINVAL; \ |
| 115 | 119 | } \ |
| 116 | 120 | \ |
| 117 | | void name##_clear(name##_t *map) \ |
| | 121 | void name##_clear(name##_t *map, DTOR_T(dtor)) \ |
| 118 | 122 | { \ |
| 119 | 123 | if (name##_is_valid(map)) { \ |
| 120 | 124 | int index; \ |
| 121 | 125 | for (index = 0; index < map->next; ++index) { \ |
| 122 | 126 | if (name##_item_is_valid(&map->items[index])) { \ |
| 123 | 127 | name##_item_destroy( \ |
| 124 | | &map->items[index]); \ |
| | 128 | &map->items[index], dtor); \ |
| 125 | 129 | } \ |
| 126 | 130 | } \ |
| 127 | 131 | map->next = 0; \ |
| … |
… |
|
| 134 | 138 | return name##_is_valid(map) ? map->next : -1; \ |
| 135 | 139 | } \ |
| 136 | 140 | \ |
| 137 | | void name##_destroy(name##_t *map) \ |
| | 141 | void name##_destroy(name##_t *map, DTOR_T(dtor)) \ |
| 138 | 142 | { \ |
| 139 | 143 | if (name##_is_valid(map)) { \ |
| 140 | 144 | int index; \ |
| … |
… |
|
| 142 | 146 | for (index = 0; index < map->next; ++index) { \ |
| 143 | 147 | if (name##_item_is_valid(&map->items[index])) { \ |
| 144 | 148 | name##_item_destroy( \ |
| 145 | | &map->items[index]); \ |
| | 149 | &map->items[index], dtor); \ |
| 146 | 150 | } \ |
| 147 | 151 | } \ |
| 148 | 152 | free(map->items); \ |
| 149 | 153 | } \ |
| 150 | 154 | } \ |
| 151 | 155 | \ |
| 152 | | void name##_exclude(name##_t *map, int key) \ |
| | 156 | void name##_exclude(name##_t *map, int key, DTOR_T(dtor)) \ |
| 153 | 157 | { \ |
| 154 | 158 | if (name##_is_valid(map)) { \ |
| 155 | 159 | int index; \ |
| … |
… |
|
| 157 | 161 | if (name##_item_is_valid(&map->items[index]) && \ |
| 158 | 162 | (map->items[index].key == key)) { \ |
| 159 | 163 | name##_item_destroy( \ |
| 160 | | &map->items[index]); \ |
| | 164 | &map->items[index], dtor); \ |
| 161 | 165 | } \ |
| 162 | 166 | } \ |
| 163 | 167 | } \ |
| 164 | 168 | } \ |
| 165 | 169 | \ |
| 166 | | void name##_exclude_index(name##_t *map, int index) \ |
| | 170 | void name##_exclude_index(name##_t *map, int index, DTOR_T(dtor)) \ |
| 167 | 171 | { \ |
| 168 | 172 | if (name##_is_valid(map) && (index >= 0) && \ |
| 169 | 173 | (index < map->next) && \ |
| 170 | 174 | name##_item_is_valid(&map->items[index])) { \ |
| 171 | | name##_item_destroy(&map->items[index]); \ |
| | 175 | name##_item_destroy(&map->items[index], dtor); \ |
| 172 | 176 | } \ |
| 173 | 177 | } \ |
| 174 | 178 | \ |
| … |
… |
|
| 235 | 239 | return map && (map->magic == INT_MAP_MAGIC_VALUE); \ |
| 236 | 240 | } \ |
| 237 | 241 | \ |
| 238 | | void name##_item_destroy(name##_item_t *item) \ |
| | 242 | void name##_item_destroy(name##_item_t *item, DTOR_T(dtor)) \ |
| 239 | 243 | { \ |
| 240 | 244 | if (name##_item_is_valid(item)) { \ |
| 241 | 245 | item->magic = 0; \ |
| 242 | 246 | if (item->value) { \ |
| 243 | | free(item->value); \ |
| | 247 | if (dtor) \ |
| | 248 | free(item->value); \ |
| 244 | 249 | item->value = NULL; \ |
| 245 | 250 | } \ |
| 246 | 251 | } \ |
=== modified file 'uspace/lib/net/tl/socket_core.c'
|
|
|
|
| 106 | 106 | if (socket_release) |
| 107 | 107 | socket_release(socket); |
| 108 | 108 | |
| 109 | | socket_cores_exclude(local_sockets, socket->socket_id); |
| | 109 | socket_cores_exclude(local_sockets, socket->socket_id, free); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | /** Destroys local sockets. |
| … |
… |
|
| 229 | 229 | return EOK; |
| 230 | 230 | |
| 231 | 231 | fail: |
| 232 | | socket_port_map_destroy(&socket_port->map); |
| | 232 | socket_port_map_destroy(&socket_port->map, free); |
| 233 | 233 | free(socket_port); |
| 234 | 234 | return rc; |
| 235 | 235 | |
| … |
… |
|
| 648 | 648 | // release if empty |
| 649 | 649 | if (socket_port->count <= 0) { |
| 650 | 650 | // destroy the map |
| 651 | | socket_port_map_destroy(&socket_port->map); |
| | 651 | socket_port_map_destroy(&socket_port->map, free); |
| 652 | 652 | // release the port |
| 653 | 653 | socket_ports_exclude(global_sockets, |
| 654 | | socket->port); |
| | 654 | socket->port, free); |
| 655 | 655 | } else { |
| 656 | 656 | // remove |
| 657 | 657 | socket_port_map_exclude(&socket_port->map, |
| 658 | | socket->key, socket->key_length); |
| | 658 | socket->key, socket->key_length, free); |
| 659 | 659 | } |
| 660 | 660 | } |
| 661 | 661 | } |
=== modified file 'uspace/lib/net/tl/tl_common.c'
|
|
|
|
| 181 | 181 | packet_dimension->content = content; |
| 182 | 182 | else |
| 183 | 183 | packet_dimensions_exclude(packet_dimensions, |
| 184 | | DEVICE_INVALID_ID); |
| | 184 | DEVICE_INVALID_ID, free); |
| 185 | 185 | } |
| 186 | 186 | } |
| 187 | 187 | |
=== modified file 'uspace/srv/net/il/arp/arp.c'
|
|
|
|
| 156 | 156 | free(proto->addr_data); |
| 157 | 157 | |
| 158 | 158 | arp_clear_addr(&proto->addresses); |
| 159 | | arp_addr_destroy(&proto->addresses); |
| | 159 | arp_addr_destroy(&proto->addresses, free); |
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | | arp_protos_clear(&device->protos); |
| | 163 | arp_protos_clear(&device->protos, free); |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | static int arp_clean_cache_req(int arp_phone) |
| … |
… |
|
| 183 | 183 | } |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | | arp_cache_clear(&arp_globals.cache); |
| | 186 | arp_cache_clear(&arp_globals.cache, free); |
| 187 | 187 | fibril_mutex_unlock(&arp_globals.lock); |
| 188 | 188 | |
| 189 | 189 | return EOK; |
| … |
… |
|
| 211 | 211 | if (trans) |
| 212 | 212 | arp_clear_trans(trans); |
| 213 | 213 | |
| 214 | | arp_addr_exclude(&proto->addresses, address->value, address->length); |
| | 214 | arp_addr_exclude(&proto->addresses, address->value, address->length, free); |
| 215 | 215 | |
| 216 | 216 | fibril_mutex_unlock(&arp_globals.lock); |
| 217 | 217 | return EOK; |
| … |
… |
|
| 344 | 344 | rc = arp_addr_add(&proto->addresses, src_proto, |
| 345 | 345 | header->protocol_length, trans); |
| 346 | 346 | if (rc != EOK) { |
| 347 | | /* The generic char map has already freed trans! */ |
| | 347 | free(trans); |
| 348 | 348 | return rc; |
| 349 | 349 | } |
| 350 | 350 | } |
| … |
… |
|
| 555 | 555 | index = arp_protos_add(&device->protos, proto->service, proto); |
| 556 | 556 | if (index < 0) { |
| 557 | 557 | fibril_mutex_unlock(&arp_globals.lock); |
| 558 | | arp_protos_destroy(&device->protos); |
| | 558 | arp_protos_destroy(&device->protos, free); |
| 559 | 559 | free(device); |
| 560 | 560 | return index; |
| 561 | 561 | } |
| … |
… |
|
| 568 | 568 | arp_receiver); |
| 569 | 569 | if (device->phone < 0) { |
| 570 | 570 | fibril_mutex_unlock(&arp_globals.lock); |
| 571 | | arp_protos_destroy(&device->protos); |
| | 571 | arp_protos_destroy(&device->protos, free); |
| 572 | 572 | free(device); |
| 573 | 573 | return EREFUSED; |
| 574 | 574 | } |
| … |
… |
|
| 578 | 578 | &device->packet_dimension); |
| 579 | 579 | if (rc != EOK) { |
| 580 | 580 | fibril_mutex_unlock(&arp_globals.lock); |
| 581 | | arp_protos_destroy(&device->protos); |
| | 581 | arp_protos_destroy(&device->protos, free); |
| 582 | 582 | free(device); |
| 583 | 583 | return rc; |
| 584 | 584 | } |
| … |
… |
|
| 588 | 588 | &device->addr_data); |
| 589 | 589 | if (rc != EOK) { |
| 590 | 590 | fibril_mutex_unlock(&arp_globals.lock); |
| 591 | | arp_protos_destroy(&device->protos); |
| | 591 | arp_protos_destroy(&device->protos, free); |
| 592 | 592 | free(device); |
| 593 | 593 | return rc; |
| 594 | 594 | } |
| … |
… |
|
| 600 | 600 | fibril_mutex_unlock(&arp_globals.lock); |
| 601 | 601 | free(device->addr); |
| 602 | 602 | free(device->addr_data); |
| 603 | | arp_protos_destroy(&device->protos); |
| | 603 | arp_protos_destroy(&device->protos, free); |
| 604 | 604 | free(device); |
| 605 | 605 | return rc; |
| 606 | 606 | } |
| … |
… |
|
| 613 | 613 | free(device->addr_data); |
| 614 | 614 | free(device->broadcast_addr); |
| 615 | 615 | free(device->broadcast_data); |
| 616 | | arp_protos_destroy(&device->protos); |
| | 616 | arp_protos_destroy(&device->protos, free); |
| 617 | 617 | free(device); |
| 618 | 618 | return rc; |
| 619 | 619 | } |
| … |
… |
|
| 745 | 745 | */ |
| 746 | 746 | arp_clear_trans(trans); |
| 747 | 747 | arp_addr_exclude(&proto->addresses, target->value, |
| 748 | | target->length); |
| | 748 | target->length, free); |
| 749 | 749 | return EAGAIN; |
| 750 | 750 | } |
| 751 | 751 | |
| … |
… |
|
| 793 | 793 | rc = arp_addr_add(&proto->addresses, target->value, target->length, |
| 794 | 794 | trans); |
| 795 | 795 | if (rc != EOK) { |
| 796 | | /* The generic char map has already freed trans! */ |
| | 796 | free(trans); |
| 797 | 797 | return rc; |
| 798 | 798 | } |
| 799 | 799 | |
| … |
… |
|
| 806 | 806 | */ |
| 807 | 807 | arp_clear_trans(trans); |
| 808 | 808 | arp_addr_exclude(&proto->addresses, target->value, |
| 809 | | target->length); |
| | 809 | target->length, free); |
| 810 | 810 | return ENOENT; |
| 811 | 811 | } |
| 812 | 812 | |
=== modified file 'uspace/srv/net/il/ip/ip.c'
|
|
|
|
| 504 | 504 | rc = ip_netif_initialize(ip_netif); |
| 505 | 505 | if (rc != EOK) { |
| 506 | 506 | fibril_rwlock_write_unlock(&ip_globals.netifs_lock); |
| 507 | | ip_routes_destroy(&ip_netif->routes); |
| | 507 | ip_routes_destroy(&ip_netif->routes, free); |
| 508 | 508 | free(ip_netif); |
| 509 | 509 | return rc; |
| 510 | 510 | } |
=== modified file 'uspace/srv/net/net/net.c'
|
|
|
|
| 554 | 554 | /* Read configuration files */ |
| 555 | 555 | rc = read_netif_configuration(conf_files[i], netif); |
| 556 | 556 | if (rc != EOK) { |
| 557 | | measured_strings_destroy(&netif->configuration); |
| | 557 | measured_strings_destroy(&netif->configuration, free); |
| 558 | 558 | free(netif); |
| 559 | 559 | return rc; |
| 560 | 560 | } |
| … |
… |
|
| 564 | 564 | measured_strings_find(&netif->configuration, (uint8_t *) CONF_NAME, 0); |
| 565 | 565 | if (!setting) { |
| 566 | 566 | fprintf(stderr, "%s: Network interface name is missing\n", NAME); |
| 567 | | measured_strings_destroy(&netif->configuration); |
| | 567 | measured_strings_destroy(&netif->configuration, free); |
| 568 | 568 | free(netif); |
| 569 | 569 | return EINVAL; |
| 570 | 570 | } |
| … |
… |
|
| 573 | 573 | /* Add to the netifs map */ |
| 574 | 574 | int index = netifs_add(&net_globals.netifs, netif->id, netif); |
| 575 | 575 | if (index < 0) { |
| 576 | | measured_strings_destroy(&netif->configuration); |
| | 576 | measured_strings_destroy(&netif->configuration, free); |
| 577 | 577 | free(netif); |
| 578 | 578 | return index; |
| 579 | 579 | } |
| … |
… |
|
| 585 | 585 | rc = char_map_add(&net_globals.netif_names, netif->name, 0, |
| 586 | 586 | index); |
| 587 | 587 | if (rc != EOK) { |
| 588 | | measured_strings_destroy(&netif->configuration); |
| 589 | | netifs_exclude_index(&net_globals.netifs, index); |
| | 588 | measured_strings_destroy(&netif->configuration, free); |
| | 589 | netifs_exclude_index(&net_globals.netifs, index, free); |
| 590 | 590 | return rc; |
| 591 | 591 | } |
| 592 | 592 | |
| … |
… |
|
| 594 | 594 | if (rc != EOK) { |
| 595 | 595 | printf("%s: Ignoring failed interface %s (%s)\n", NAME, |
| 596 | 596 | netif->name, str_error(rc)); |
| 597 | | measured_strings_destroy(&netif->configuration); |
| 598 | | netifs_exclude_index(&net_globals.netifs, index); |
| | 597 | measured_strings_destroy(&netif->configuration, free); |
| | 598 | netifs_exclude_index(&net_globals.netifs, index, free); |
| 599 | 599 | continue; |
| 600 | 600 | } |
| 601 | 601 | |
=== modified file 'uspace/srv/net/nil/eth/eth.c'
|
|
|
|
| 213 | 213 | rc = eth_protos_initialize(ð_globals.protos); |
| 214 | 214 | if (rc != EOK) { |
| 215 | 215 | free(eth_globals.broadcast_addr); |
| 216 | | eth_devices_destroy(ð_globals.devices); |
| | 216 | eth_devices_destroy(ð_globals.devices, free); |
| 217 | 217 | } |
| 218 | 218 | out: |
| 219 | 219 | fibril_rwlock_write_unlock(ð_globals.protos_lock); |
=== modified file 'uspace/srv/net/tl/tcp/tcp.c'
|
|
|
|
| 1706 | 1706 | /* Unbind if bound */ |
| 1707 | 1707 | if (socket->port > 0) { |
| 1708 | 1708 | socket_ports_exclude(&tcp_globals.sockets, |
| 1709 | | socket->port); |
| | 1709 | socket->port, free); |
| 1710 | 1710 | socket->port = 0; |
| 1711 | 1711 | } |
| 1712 | 1712 | } |
| … |
… |
|
| 2491 | 2491 | |
| 2492 | 2492 | rc = packet_dimensions_initialize(&tcp_globals.dimensions); |
| 2493 | 2493 | if (rc != EOK) { |
| 2494 | | socket_ports_destroy(&tcp_globals.sockets); |
| | 2494 | socket_ports_destroy(&tcp_globals.sockets, free); |
| 2495 | 2495 | goto out; |
| 2496 | 2496 | } |
| 2497 | 2497 | |
=== modified file 'uspace/srv/net/tl/udp/udp.c'
|
|
|
|
| 416 | 416 | |
| 417 | 417 | rc = packet_dimensions_initialize(&udp_globals.dimensions); |
| 418 | 418 | if (rc != EOK) { |
| 419 | | socket_ports_destroy(&udp_globals.sockets); |
| | 419 | socket_ports_destroy(&udp_globals.sockets, free); |
| 420 | 420 | fibril_rwlock_write_unlock(&udp_globals.lock); |
| 421 | 421 | return rc; |
| 422 | 422 | } |
| … |
… |
|
| 433 | 433 | rc = net_get_conf_req(udp_globals.net_phone, &configuration, count, |
| 434 | 434 | &data); |
| 435 | 435 | if (rc != EOK) { |
| 436 | | socket_ports_destroy(&udp_globals.sockets); |
| | 436 | socket_ports_destroy(&udp_globals.sockets, free); |
| 437 | 437 | fibril_rwlock_write_unlock(&udp_globals.lock); |
| 438 | 438 | return rc; |
| 439 | 439 | } |