summaryrefslogtreecommitdiff
path: root/doc/examples/tlsproxy/buffer.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2019-05-14 21:39:46 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2019-05-14 21:42:28 +0200
commitbb31860b6e034e99d75173ed39e72e2b3a6ebe66 (patch)
treec1ff24cbd587eea3b8f583780010fc055a7d0897 /doc/examples/tlsproxy/buffer.c
parent3cc7043df62cf20f908316fefdc065e946eebfa3 (diff)
downloadgnutls-tmp-check-allocations.tar.gz
Check all memory allocation in examples and certtooltmp-check-allocations
Resolves: #739 Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Diffstat (limited to 'doc/examples/tlsproxy/buffer.c')
-rw-r--r--doc/examples/tlsproxy/buffer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/doc/examples/tlsproxy/buffer.c b/doc/examples/tlsproxy/buffer.c
index cd1ff37eea..05c82121fe 100644
--- a/doc/examples/tlsproxy/buffer.c
+++ b/doc/examples/tlsproxy/buffer.c
@@ -80,6 +80,8 @@ buffer_t *
bufNew (ssize_t size, ssize_t hwm)
{
buffer_t *b = calloc (1, sizeof (buffer_t));
+ if (!b) return NULL;
+
b->buf = calloc (1, size);
b->size = size;
b->hwm = hwm;