diff options
author | Darren Tucker <dtucker@zip.com.au> | 2003-09-23 18:55:43 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2003-09-23 18:55:43 +1000 |
commit | e1318fb07f775f2d54cacd98c217de9c25fbe964 (patch) | |
tree | 697f887b253e75a2f47c3166c819895e8b41887d /buffer.c | |
parent | d640322dd83423ee78cea4d576ea29395454dabd (diff) |
- markus@cvs.openbsd.org 2003/09/18 07:54:48
[buffer.c]
protect against double free; #660; zardoz at users.sf.net
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -12,7 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include "includes.h" | 14 | #include "includes.h" |
15 | RCSID("$OpenBSD: buffer.c,v 1.18 2003/09/16 21:02:39 markus Exp $"); | 15 | RCSID("$OpenBSD: buffer.c,v 1.19 2003/09/18 07:54:48 markus Exp $"); |
16 | 16 | ||
17 | #include "xmalloc.h" | 17 | #include "xmalloc.h" |
18 | #include "buffer.h" | 18 | #include "buffer.h" |
@@ -39,6 +39,7 @@ buffer_free(Buffer *buffer) | |||
39 | { | 39 | { |
40 | if (buffer->alloc > 0) { | 40 | if (buffer->alloc > 0) { |
41 | memset(buffer->buf, 0, buffer->alloc); | 41 | memset(buffer->buf, 0, buffer->alloc); |
42 | buffer->alloc = 0; | ||
42 | xfree(buffer->buf); | 43 | xfree(buffer->buf); |
43 | } | 44 | } |
44 | } | 45 | } |