macro based on ASN_STRUCT_RESET to replace ASN_STRUCT_FREE because the latter does not reset to NULL pointers inside the structure

This commit is contained in:
francescomani
2023-12-20 11:34:59 +01:00
parent 6dc9ec7733
commit 0f720d3969
5 changed files with 73 additions and 157 deletions
+6
View File
@@ -117,5 +117,11 @@ static inline uint64_t BIT_STRING_to_uint64(BIT_STRING_t *asn) {
#define asn1cSequenceAdd(VaR, TyPe, lOcPtr) \
TyPe *lOcPtr= calloc(1,sizeof(TyPe)); \
asn1cSeqAdd(&VaR,lOcPtr)
#define asn1cFreeStruc(ASN_DEF, STRUCT) \
do { \
ASN_STRUCT_RESET(ASN_DEF, STRUCT); \
free(STRUCT); \
STRUCT = NULL; \
} while (0)
#endif