From c29cf4bcd33b6dd9e1bba8a5e23da8e22aba19d4 Mon Sep 17 00:00:00 2001 From: Zdenek Styblik Date: Thu, 25 Apr 2013 07:50:45 +0000 Subject: [PATCH] ID: 3611303 - 'src/plugins/lan/lan.c' - error check is missing braces Fixed a bug where connecting to a remote shelf manager via the lan interface would always fail with: ``Activate Session error: Session sequence out of range Error: Unable to establish LAN session'' This is due to a bug introduced in get_random() by fix for ID#3600963 where braces were missing from an error check. Commit for Dan Gora --- ipmitool/src/plugins/lan/lan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ipmitool/src/plugins/lan/lan.c b/ipmitool/src/plugins/lan/lan.c index 77f3068..3fee95f 100644 --- a/ipmitool/src/plugins/lan/lan.c +++ b/ipmitool/src/plugins/lan/lan.c @@ -212,9 +212,10 @@ get_random(void *data, int len) if (fd < 0) return errno; - if (len < 0) + if (len < 0) { close(fd); return errno; /* XXX: ORLY? */ + } rv = read(fd, data, len);