summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Benoit <benno@cvs.openbsd.org>2015-12-29 18:05:02 +0000
committerSebastian Benoit <benno@cvs.openbsd.org>2015-12-29 18:05:02 +0000
commit6a3facf5654a6b0d3672d34d99ec56816f3c459f (patch)
tree8e7df017b7471bd575f31dfdc1ced2315d211494
parent1324648004cd87808793311cabc869250cc209bd (diff)
check for NULL in ibuf_free().
ok and slight improvement, mmcco@ ok semarie@ and encouragement tedu@ krw@
-rw-r--r--lib/libutil/imsg-buffer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libutil/imsg-buffer.c b/lib/libutil/imsg-buffer.c
index bac62f1e38e..58c6655fec8 100644
--- a/lib/libutil/imsg-buffer.c
+++ b/lib/libutil/imsg-buffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: imsg-buffer.c,v 1.7 2015/07/12 18:40:49 nicm Exp $ */
+/* $OpenBSD: imsg-buffer.c,v 1.8 2015/12/29 18:05:01 benno Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -180,6 +180,8 @@ again:
void
ibuf_free(struct ibuf *buf)
{
+ if (buf == NULL)
+ return;
free(buf->buf);
free(buf);
}