Commit 309f193a authored by v0-e's avatar v0-e

SEQUENCE_free, CHOICE_free null pointer check fix

parent bbde80f6
...@@ -156,13 +156,14 @@ CHOICE_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, ...@@ -156,13 +156,14 @@ CHOICE_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
void void
CHOICE_free(const asn_TYPE_descriptor_t *td, void *ptr, CHOICE_free(const asn_TYPE_descriptor_t *td, void *ptr,
enum asn_struct_free_method method) { enum asn_struct_free_method method) {
const asn_CHOICE_specifics_t *specs = const asn_CHOICE_specifics_t *specs;
(const asn_CHOICE_specifics_t *)td->specifics;
unsigned present; unsigned present;
if(!td || !ptr) if(!td || !ptr)
return; return;
specs = (const asn_CHOICE_specifics_t *)td->specifics;
ASN_DEBUG("Freeing %s as CHOICE", td->name); ASN_DEBUG("Freeing %s as CHOICE", td->name);
/* /*
......
...@@ -68,13 +68,14 @@ void ...@@ -68,13 +68,14 @@ void
SEQUENCE_free(const asn_TYPE_descriptor_t *td, void *sptr, SEQUENCE_free(const asn_TYPE_descriptor_t *td, void *sptr,
enum asn_struct_free_method method) { enum asn_struct_free_method method) {
size_t edx; size_t edx;
const asn_SEQUENCE_specifics_t *specs = const asn_SEQUENCE_specifics_t *specs;
(const asn_SEQUENCE_specifics_t *)td->specifics;
asn_struct_ctx_t *ctx; /* Decoder context */ asn_struct_ctx_t *ctx; /* Decoder context */
if(!td || !sptr) if(!td || !sptr)
return; return;
specs = (const asn_SEQUENCE_specifics_t *)td->specifics;
ASN_DEBUG("Freeing %s as SEQUENCE", td->name); ASN_DEBUG("Freeing %s as SEQUENCE", td->name);
for(edx = 0; edx < td->elements_count; edx++) { for(edx = 0; edx < td->elements_count; edx++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment