Fix unguarded free test
diff --git a/src/cose_int.h b/src/cose_int.h
index 8cf210b..28cb7c3 100644
--- a/src/cose_int.h
+++ b/src/cose_int.h
@@ -107,7 +107,7 @@
* @param free_func [description]
* @return [description]
*/
-#define COSE_FREE(ptr, ctx) (((ctx)->free_func) ? \
+#define COSE_FREE(ptr, ctx) ((((ctx) && (ctx)->free_func)) ? \
((ctx)->free_func((ptr), (ctx)->context)) : \
free((ptr)))
@@ -205,8 +205,8 @@
//
// Debugging Items
-#define DO_ASSERT assert(false);
-//#define DO_ASSERT
+//#define DO_ASSERT assert(false);
+#define DO_ASSERT
#define CHECK_CONDITION(condition, error) { if (!(condition)) { DO_ASSERT; if (perr != NULL) {perr->err = error;} goto errorReturn;}}
#define FAIL_CONDITION(error) { DO_ASSERT; if (perr != NULL) {perr->err = error;} goto errorReturn;}
#define CHECK_CONDITION_CBOR(condition, error) { if (!(condition)) { DO_ASSERT; if (perr != NULL) {perr->err = _MapFromCBOR(error);} goto errorReturn;}}