aboutsummaryrefslogtreecommitdiffstats
path: root/ifuncs.h
diff options
context:
space:
mode:
Diffstat (limited to 'ifuncs.h')
-rw-r--r--ifuncs.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/ifuncs.h b/ifuncs.h
index 8c128d58..656597ec 100644
--- a/ifuncs.h
+++ b/ifuncs.h
@@ -35,6 +35,14 @@ realloc_xbuf(xbuf *xb, size_t sz)
xb->size = sz;
}
+static inline void
+free_xbuf(xbuf *xb)
+{
+ if (xb->buf)
+ free(xb->buf);
+ memset(xb, 0, sizeof (xbuf));
+}
+
static inline int
to_wire_mode(mode_t mode)
{