Commit 70faaca97d7508f7f1c2c27cb2ee5c083a900111

Con Kolivas 2014-07-17T11:52:23

Only clear sockbuf if it's been allocated

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/util.c b/util.c
index 2cf513a..ea238a2 100644
--- a/util.c
+++ b/util.c
@@ -1562,7 +1562,8 @@ bool sock_full(struct pool *pool)
 
 static void clear_sockbuf(struct pool *pool)
 {
-	strcpy(pool->sockbuf, "");
+	if (likely(pool->sockbuf))
+		strcpy(pool->sockbuf, "");
 }
 
 static void clear_sock(struct pool *pool)