Skip to content
Snippets Groups Projects
Commit a8bbbda1 authored by Lev Walkin's avatar Lev Walkin
Browse files

handling temporary structure

parent 1411d05e
No related branches found
No related tags found
No related merge requests found
...@@ -127,6 +127,9 @@ NativeReal_encode_der(asn_TYPE_descriptor_t *td, void *ptr, ...@@ -127,6 +127,9 @@ NativeReal_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
asn_enc_rval_t erval; asn_enc_rval_t erval;
REAL_t tmp; REAL_t tmp;
/* Prepare a temporary clean structure */
memset(&tmp, 0, sizeof(tmp));
if(asn_double2REAL(&tmp, Dbl)) { if(asn_double2REAL(&tmp, Dbl)) {
erval.encoded = -1; erval.encoded = -1;
erval.failed_type = td; erval.failed_type = td;
...@@ -140,6 +143,10 @@ NativeReal_encode_der(asn_TYPE_descriptor_t *td, void *ptr, ...@@ -140,6 +143,10 @@ NativeReal_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
assert(erval.structure_ptr == &tmp); assert(erval.structure_ptr == &tmp);
erval.structure_ptr = ptr; erval.structure_ptr = ptr;
} }
/* Free possibly allocated members of the temporary structure */
asn_DEF_REAL.free_struct(&asn_DEF_REAL, &tmp, 1);
return erval; return erval;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment