Browse Source

check for NULL in ibuf_free().

ok and slight improvement, mmcco@
ok semarie@ and encouragement tedu@ krw@
OPENBSD_5_9
benno 9 years ago
parent
commit
a3c84db0c2
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      src/lib/libutil/imsg-buffer.c

+ 3
- 1
src/lib/libutil/imsg-buffer.c View File

@ -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> * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -180,6 +180,8 @@ again:
void void
ibuf_free(struct ibuf *buf) ibuf_free(struct ibuf *buf)
{ {
if (buf == NULL)
return;
free(buf->buf); free(buf->buf);
free(buf); free(buf);
} }


Loading…
Cancel
Save