summaryrefslogtreecommitdiff
path: root/system.h
diff options
context:
space:
mode:
Diffstat (limited to 'system.h')
-rw-r--r--system.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/system.h b/system.h
index 3d7dd4a06..10d9e0634 100644
--- a/system.h
+++ b/system.h
@@ -233,6 +233,19 @@ typedef char * security_context_t;
#define rpm_execcon(_v, _fn, _av, _envp) (0)
#endif
+/**
+ * Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
+ * @param p memory to free
+ * @return NULL always
+ */
+static inline
+void * _free(const void * p)
+{
+ if (p != NULL) free((void *)p);
+ return NULL;
+}
+
+
/* FIX: these are macros */
/**
*/