• Bi-Ruei, Chiu's avatar
    Free memory allocated in various functions · b9adfc5f
    Bi-Ruei, Chiu authored
    1. Add 'ref_cnt' field to asn1p_expr_t.
    2. Initialize 'ref_cnt' field to zero when asn1p_expr_t is allocated.
    3. Increase 'ref_cnt' field when asn1p_expr_t is cloned by asn1p_value_fromtype().
    4. If 'ref_cnt' field of asn1p_expr_t is larger than zero, then asn1p_expr_free() only decrease its value.
    5. Free memory pointed by fields of asn1p_expr_t and itself when 'ref_cnt' is zero and asn1p_expr_free() called.
    6. Call asn1p_delete(asn) in main().
    b9adfc5f
asn1p_value.c 5.64 KB