Skip to content

Commit

Permalink
Merge pull request vlm#12 from brchiu/zero_out_structure_when_free_co…
Browse files Browse the repository at this point in the history
…ntent_only

Zero out memory when free content only
  • Loading branch information
mouse07410 authored Apr 13, 2017
2 parents 4fc4f8f + f75d1a9 commit 2669a7f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions skeletons/OCTET_STRING.c
Original file line number Diff line number Diff line change
Expand Up @@ -2104,6 +2104,8 @@ OCTET_STRING_free(asn_TYPE_descriptor_t *td, void *sptr, int contents_only) {

if(!contents_only) {
FREEMEM(st);
} else if(td->specifics) {
memset(st, 0, ((asn_OCTET_STRING_specifics_t *)(td->specifics))->struct_size);
}
}

Expand Down
2 changes: 2 additions & 0 deletions skeletons/constr_CHOICE.c
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,8 @@ CHOICE_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) {

if(!contents_only) {
FREEMEM(ptr);
} else if(td->specifics) {
memset(ptr, 0, ((asn_CHOICE_specifics_t *)(td->specifics))->struct_size);
}
}

Expand Down
2 changes: 2 additions & 0 deletions skeletons/constr_SEQUENCE.c
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,8 @@ SEQUENCE_free(asn_TYPE_descriptor_t *td, void *sptr, int contents_only) {

if(!contents_only) {
FREEMEM(sptr);
} else if(td->specifics) {
memset(sptr, 0, ((asn_SEQUENCE_specifics_t *)(td->specifics))->struct_size);
}
}

Expand Down
2 changes: 2 additions & 0 deletions skeletons/constr_SET.c
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,8 @@ SET_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) {

if(!contents_only) {
FREEMEM(ptr);
} else if(td->specifics) {
memset(ptr, 0, ((asn_SET_specifics_t *)(td->specifics))->struct_size);
}
}

Expand Down
2 changes: 2 additions & 0 deletions skeletons/constr_SET_OF.c
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,8 @@ SET_OF_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) {

if(!contents_only) {
FREEMEM(ptr);
} else if(td->specifics) {
memset(ptr, 0, ((asn_SET_OF_specifics_t *)(td->specifics))->struct_size);
}
}
}
Expand Down

0 comments on commit 2669a7f

Please sign in to comment.