#ifdef NO_ASSERT
# define MEM(x) error "Use of MEM() not allowed in this source file. Deal with memory allocation failure gracefully"
#else
-# define MEM(x) do { if (!(x)) { fr_cond_assert_msg((x), "OUT OF MEMORY"); _fr_exit(__FILE__, __LINE__, EXIT_FAILURE, true); } } while (0)
+/* Short circuit condition to prevent duplicate evaluation */
+# define MEM(x) do { if (!(x)) { fr_cond_assert_msg(0 && (x), "OUT OF MEMORY"); _fr_exit(__FILE__, __LINE__, EXIT_FAILURE, true); } } while (0)
#endif
typedef enum {