From fc4310cda7d410d08ce09aa4c09891cde04784e2 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Thu, 1 Aug 2024 13:27:35 +0200 Subject: [PATCH] fix multi-statement marco asn1cCallocOne() --- common/utils/oai_asn1.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/utils/oai_asn1.h b/common/utils/oai_asn1.h index 573fa94d75..600aea1392 100644 --- a/common/utils/oai_asn1.h +++ b/common/utils/oai_asn1.h @@ -216,7 +216,10 @@ static inline uint64_t BIT_STRING_to_uint64(const BIT_STRING_t *asn) { #define asn1cSeqAdd(VaR, PtR) if (ASN_SEQUENCE_ADD(VaR,PtR)!=0) AssertFatal(false, "ASN.1 encoding error " #VaR "\n") #define asn1cCallocOne(VaR, VaLue) \ - VaR = calloc(1,sizeof(*VaR)); *VaR=VaLue + do { \ + VaR = calloc(1,sizeof(*VaR)); \ + *VaR = VaLue; \ + } while (0) #define asn1cCalloc(VaR, lOcPtr) \ typeof(VaR) lOcPtr = VaR = calloc(1,sizeof(*VaR)) #define asn1cSequenceAdd(VaR, TyPe, lOcPtr) \