aboutsummaryrefslogtreecommitdiffstats
path: root/skeletons
diff options
context:
space:
mode:
authorvlm <vlm@59561ff5-6e30-0410-9f3c-9617f08c8826>2005-02-06 04:29:03 +0000
committervlm <vlm@59561ff5-6e30-0410-9f3c-9617f08c8826>2005-02-06 04:29:03 +0000
commit83386efb2d35572727fd67cd73ca1fffa326be3d (patch)
tree5e4479518e58e651d8e543e84ee5cac09f2d09a7 /skeletons
parent602b726b31d3fb4b0202272bf3d65af10bfe54c4 (diff)
handling temporary structure
git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@625 59561ff5-6e30-0410-9f3c-9617f08c8826
Diffstat (limited to 'skeletons')
-rw-r--r--skeletons/NativeReal.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/skeletons/NativeReal.c b/skeletons/NativeReal.c
index 594bdb5f..810d510b 100644
--- a/skeletons/NativeReal.c
+++ b/skeletons/NativeReal.c
@@ -127,6 +127,9 @@ NativeReal_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
asn_enc_rval_t erval;
REAL_t tmp;
+ /* Prepare a temporary clean structure */
+ memset(&tmp, 0, sizeof(tmp));
+
if(asn_double2REAL(&tmp, Dbl)) {
erval.encoded = -1;
erval.failed_type = td;
@@ -140,6 +143,10 @@ NativeReal_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
assert(erval.structure_ptr == &tmp);
erval.structure_ptr = ptr;
}
+
+ /* Free possibly allocated members of the temporary structure */
+ asn_DEF_REAL.free_struct(&asn_DEF_REAL, &tmp, 1);
+
return erval;
}