Add MBEDTLS_ASN1_CHK_CLEANUP_ADD macro to be able to release memory on failure
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
parent
5a49d3cce3
commit
57207711d8
2 changed files with 30 additions and 14 deletions
|
@ -35,6 +35,15 @@
|
|||
(g) += ret; \
|
||||
} while (0)
|
||||
|
||||
#define MBEDTLS_ASN1_CHK_CLEANUP_ADD(g, f) \
|
||||
do \
|
||||
{ \
|
||||
if ((ret = (f)) < 0) \
|
||||
goto cleanup; \
|
||||
else \
|
||||
(g) += ret; \
|
||||
} while (0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue