Message ID | 20171123140444.17119-3-sven.eckelmann@openmesh.com |
---|---|
State | Accepted, archived |
Commit | aa316bf6d1b2cf0ab7189ed8620c17f5018d4d37 |
Delegated to: | Simon Wunderlich |
Headers |
Return-Path: <b.a.t.m.a.n-bounces@lists.open-mesh.org> X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id 91B8B80674; Thu, 23 Nov 2017 15:05:20 +0100 (CET) Authentication-Results: open-mesh.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=openmesh-com.20150623.gappssmtp.com header.i=@openmesh-com.20150623.gappssmtp.com header.b="a/ZFbIHK"; dkim-atps=neutral Received-SPF: None (mailfrom) identity=mailfrom; client-ip=2607:f8b0:400d:c09::241; helo=mail-qk0-x241.google.com; envelope-from=sven.eckelmann@openmesh.com; receiver=<UNKNOWN> Received: from mail-qk0-x241.google.com (mail-qk0-x241.google.com [IPv6:2607:f8b0:400d:c09::241]) by open-mesh.org (Postfix) with ESMTPS id 44DE980639 for <b.a.t.m.a.n@lists.open-mesh.org>; Thu, 23 Nov 2017 15:05:09 +0100 (CET) Received: by mail-qk0-x241.google.com with SMTP id f63so21093053qke.8 for <b.a.t.m.a.n@lists.open-mesh.org>; Thu, 23 Nov 2017 06:05:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openmesh-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xQdc0iUbCaYdNYG4CvcR7IsKX9JmO/AoThxupvwTBnI=; b=a/ZFbIHKZAxgrNJaPfxIhsQTrUbodNO9kUX/cLnu5Fo0s4dmLgM7pRbmdU2cJ0WLO5 xMRR45MYNSfORm3JrtC/fG3JFWXR6X4sYCstl0fkiWMIZX/x8bnNewt6JRJ5DV6isqme BBbeXBVmmtNhyUBEn69WNoaG8+VgTj7M6xZ1yp+Zm77z0oskpIP0oUyrXejSJsPCiz3f jd/VVPiVATfntaqZLdTPxUClqqioPGLYRP1gO5+AwOyPhFsL8GXvYLpi+V2zoFeWrXk3 y+eECPFDruQzMWuNLwOsyn/TC+xrzGEccnd818xCPO4ZrQDShljhmv01IRrVL028Qxn7 EF0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xQdc0iUbCaYdNYG4CvcR7IsKX9JmO/AoThxupvwTBnI=; b=mbThEoFFr3aAy9NrRBs5FzyucZQVufQ9Vq+EHnlidWuOZI9jg2sjBaQSAtpUZghI+y 773KAv7rRgUwUNuLKGzyMppl3yBN7xJhR8KZN5D4pt8IwdPFfXn6aZLsR4fkgZYAmxlI 2bZZ8OzZPMksXtTNgit+fxj2fHOTtUe0ajIhxy33edjRZRsNdOe9byIJftcu4ZE8g9hJ 3IfETkc/gm1vVRVOfQFW+e1I8qUed2gRXTtWefZTKvWLhiB0dyPWWrVf8MEMXyRkdEL2 j9sqAcC6tGOpeWsaukNMESK6KinwMRe7c8yTdcO6avBKxJChy5xHCMAsu8oz60Ysj8po BDqA== X-Gm-Message-State: AJaThX6N2UWwujS5VGldIsk3DlGv1AAMcdVJANMI3BTQQe6+rxM7YQsW 8/+IGrTPBpIG2f9zOJ0Ifp8Oyw42 X-Google-Smtp-Source: AGs4zMaco8smOWbd5MZUA8sgBdC/Gefh4+l4u4ZohW0bnEpQi39I7CFibK84HpWVEz7ONx4BnmbEuQ== X-Received: by 10.55.191.135 with SMTP id p129mr17719553qkf.211.1511445908147; Thu, 23 Nov 2017 06:05:08 -0800 (PST) Received: from sven-desktop.home.narfation.org (p2003007C6F53F7FA6FAE965552C91071.dip0.t-ipconnect.de. [2003:7c:6f53:f7fa:6fae:9655:52c9:1071]) by smtp.gmail.com with ESMTPSA id 46sm13171727qtx.65.2017.11.23.06.05.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Nov 2017 06:05:07 -0800 (PST) From: Sven Eckelmann <sven.eckelmann@openmesh.com> To: b.a.t.m.a.n@lists.open-mesh.org Date: Thu, 23 Nov 2017 15:04:36 +0100 Message-Id: <20171123140444.17119-3-sven.eckelmann@openmesh.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171123140444.17119-1-sven.eckelmann@openmesh.com> References: <20171123140444.17119-1-sven.eckelmann@openmesh.com> Subject: [B.A.T.M.A.N.] [PATCH 02/10] batctl: Handle failure during hash_iterator allocation X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking <b.a.t.m.a.n.lists.open-mesh.org> List-Unsubscribe: <https://lists.open-mesh.org/mm/options/b.a.t.m.a.n>, <mailto:b.a.t.m.a.n-request@lists.open-mesh.org?subject=unsubscribe> List-Archive: <http://lists.open-mesh.org/pipermail/b.a.t.m.a.n/> List-Post: <mailto:b.a.t.m.a.n@lists.open-mesh.org> List-Help: <mailto:b.a.t.m.a.n-request@lists.open-mesh.org?subject=help> List-Subscribe: <https://lists.open-mesh.org/mm/listinfo/b.a.t.m.a.n>, <mailto:b.a.t.m.a.n-request@lists.open-mesh.org?subject=subscribe> Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking <b.a.t.m.a.n@lists.open-mesh.org> Cc: Sven Eckelmann <sven.eckelmann@openmesh.com> Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" <b.a.t.m.a.n-bounces@lists.open-mesh.org> |
Series |
batctl: Fixes and minor cleanup
|
|
Commit Message
Sven Eckelmann
Nov. 23, 2017, 2:04 p.m. UTC
The iterator functions should not try to start the iteration when the
iterator could not be allocated.
Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
---
hash.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hash.c b/hash.c index f4a7af7..0e4d1e3 100644 --- a/hash.c +++ b/hash.c @@ -120,6 +120,9 @@ struct hash_it_t *hash_iterate(struct hashtable_t *hash, if (iter_in == NULL) { iter = debugMalloc(sizeof(struct hash_it_t), 301); + if (!iter) + return NULL; + iter->index = -1; iter->bucket = NULL; iter->prev_bucket = NULL;