BUG/MINOR: peers: Missing calloc return value check in peers_register_table

A memory allocation failure happening during peers_register_table would
have resulted in a crash. This function is only called during init.

It was raised in GitHub issue #1233.
It could be backported to all stable branches.

(cherry picked from commit 208ff01b23eda19fe41780310f4d08ca86e28766)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/src/peers.c b/src/peers.c
index 3f88508..3a980dd 100644
--- a/src/peers.c
+++ b/src/peers.c
@@ -3366,16 +3366,21 @@
 
 /*
  * Function used to register a table for sync on a group of peers
- *
+ * Returns 0 in case of success.
  */
-void peers_register_table(struct peers *peers, struct stktable *table)
+int peers_register_table(struct peers *peers, struct stktable *table)
 {
 	struct shared_table *st;
 	struct peer * curpeer;
 	int id = 0;
+	int retval = 0;
 
 	for (curpeer = peers->remote; curpeer; curpeer = curpeer->next) {
 		st = calloc(1,sizeof(*st));
+		if (!st) {
+			retval = 1;
+			break;
+		}
 		st->table = table;
 		st->next = curpeer->tables;
 		if (curpeer->tables)
@@ -3393,6 +3398,8 @@
 	}
 
 	table->sync_task = peers->sync_task;
+
+	return retval;
 }
 
 /*