aboutsummaryrefslogtreecommitdiffstats
path: root/skeletons/OCTET_STRING.c
diff options
context:
space:
mode:
authorLev Walkin <vlm@lionet.info>2017-08-25 01:06:00 -0700
committerLev Walkin <vlm@lionet.info>2017-08-25 01:06:00 -0700
commit8d99d7b5c87d5a805472a51007d5f640932d435e (patch)
tree6c77b9f44924e060d2c0a0cd00e515115762b97c /skeletons/OCTET_STRING.c
parent56d59b46c0d2c679e1632d9cd399db48376e9aba (diff)
introduced ASN_STRUCT_RESET; preferred over ASN_STRUCT_FREE_CONTENTS_ONLY
Diffstat (limited to 'skeletons/OCTET_STRING.c')
-rw-r--r--skeletons/OCTET_STRING.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/skeletons/OCTET_STRING.c b/skeletons/OCTET_STRING.c
index 64be97e3..1b33c5ea 100644
--- a/skeletons/OCTET_STRING.c
+++ b/skeletons/OCTET_STRING.c
@@ -1731,8 +1731,8 @@ OCTET_STRING_print_utf8(asn_TYPE_descriptor_t *td, const void *sptr,
void
OCTET_STRING_free(const asn_TYPE_descriptor_t *td, void *sptr,
- int contents_only) {
- OCTET_STRING_t *st = (OCTET_STRING_t *)sptr;
+ enum asn_struct_free_method method) {
+ OCTET_STRING_t *st = (OCTET_STRING_t *)sptr;
asn_OCTET_STRING_specifics_t *specs;
asn_struct_ctx_t *ctx;
struct _stack *stck;
@@ -1765,9 +1765,17 @@ OCTET_STRING_free(const asn_TYPE_descriptor_t *td, void *sptr,
FREEMEM(stck);
}
- if(!contents_only) {
- FREEMEM(st);
- }
+ switch(method) {
+ case ASFM_FREE_EVERYTHING:
+ FREEMEM(sptr);
+ break;
+ case ASFM_FREE_UNDERLYING:
+ break;
+ case ASFM_FREE_UNDERLYING_AND_RESET:
+ memset(sptr, 0,
+ ((asn_OCTET_STRING_specifics_t *)(td->specifics))->struct_size);
+ break;
+ }
}
/*