File 0008-wsmc_create-error-out-if-calloc-fails.patch of Package openwsman.10653

From df12853852b9b0fd2b379eca60e34ff6b45d3339 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= <kkaempf@suse.de>
Date: Tue, 25 Aug 2015 12:16:51 +0200
Subject: [PATCH 08/15] wsmc_create: error out if calloc fails

---
 src/lib/wsman-client.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/lib/wsman-client.c b/src/lib/wsman-client.c
index b958279452ff..88ad07c54644 100644
--- a/src/lib/wsman-client.c
+++ b/src/lib/wsman-client.c
@@ -1988,6 +1988,10 @@ wsmc_create(const char *hostname,
 		const char *password)
 {
 	WsManClient *wsc = (WsManClient *) calloc(1, sizeof(WsManClient));
+        if (wsc == NULL) {
+          error("Can't alloc WsManClient");
+          return NULL;
+        }
 	wsc->hdl = &wsc->data;
 
 	if (pthread_mutex_init(&wsc->mutex, NULL)) {
-- 
2.18.0