aboutsummaryrefslogtreecommitdiff
path: root/nxcomp/src/Misc.h
diff options
context:
space:
mode:
Diffstat (limited to 'nxcomp/src/Misc.h')
-rw-r--r--nxcomp/src/Misc.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/nxcomp/src/Misc.h b/nxcomp/src/Misc.h
index 997630137..7808c34c2 100644
--- a/nxcomp/src/Misc.h
+++ b/nxcomp/src/Misc.h
@@ -54,6 +54,9 @@ using namespace std;
#define EGET() (errno)
#define ESTR() strerror(errno)
+// a free() macro that clears the ptr after free
+#define SAFE_FREE(ptr) do { free(ptr); ptr = NULL; } while (0)
+
//
// TCP port offset applied to NX port specification.
//