Skip to content
This repository was archived by the owner on Apr 24, 2019. It is now read-only.

Commit c4684e7

Browse files
Antti Yli-TokolaTeroJaasko
authored andcommitted
Do not NULL location_ptr in set_endpoint_info.
This will lead to memory leak in sn_nsdl_set_endpoint_location call.
1 parent 456f0f7 commit c4684e7

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

source/libNsdl/src/sn_nsdl.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,7 @@ int8_t sn_nsdl_destroy(struct nsdl_s *handle)
129129
handle->ep_information_ptr->type_ptr = 0;
130130
}
131131

132-
if (handle->ep_information_ptr->lifetime_ptr)
133-
134-
{
132+
if (handle->ep_information_ptr->lifetime_ptr) {
135133
handle->sn_nsdl_free(handle->ep_information_ptr->lifetime_ptr);
136134
handle->ep_information_ptr->lifetime_ptr = 0;
137135
}
@@ -1556,9 +1554,6 @@ static int8_t set_endpoint_info(struct nsdl_s *handle, sn_nsdl_ep_parameters_s *
15561554
handle->ep_information_ptr->binding_and_mode = endpoint_info_ptr->binding_and_mode;
15571555
handle->ep_information_ptr->ds_register_mode = endpoint_info_ptr->ds_register_mode;
15581556

1559-
handle->ep_information_ptr->location_ptr = 0;
1560-
handle->ep_information_ptr->location_len = 0;
1561-
15621557
return 0;
15631558
}
15641559

0 commit comments

Comments
 (0)