Unverified Commit 57281aa4 authored by Mouse's avatar Mouse Committed by GitHub

Merge pull request #155 from v0-e/td-null-check-fix

SEQUENCE_free, CHOICE_free null pointer check fix
parents df2b288b 309f193a
......@@ -156,13 +156,14 @@ CHOICE_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
void
CHOICE_free(const asn_TYPE_descriptor_t *td, void *ptr,
enum asn_struct_free_method method) {
const asn_CHOICE_specifics_t *specs =
(const asn_CHOICE_specifics_t *)td->specifics;
const asn_CHOICE_specifics_t *specs;
unsigned present;
if(!td || !ptr)
return;
specs = (const asn_CHOICE_specifics_t *)td->specifics;
ASN_DEBUG("Freeing %s as CHOICE", td->name);
/*
......
......@@ -68,13 +68,14 @@ void
SEQUENCE_free(const asn_TYPE_descriptor_t *td, void *sptr,
enum asn_struct_free_method method) {
size_t edx;
const asn_SEQUENCE_specifics_t *specs =
(const asn_SEQUENCE_specifics_t *)td->specifics;
const asn_SEQUENCE_specifics_t *specs;
asn_struct_ctx_t *ctx; /* Decoder context */
if(!td || !sptr)
return;
specs = (const asn_SEQUENCE_specifics_t *)td->specifics;
ASN_DEBUG("Freeing %s as SEQUENCE", td->name);
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