From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Marek Lindner Date: Thu, 5 Jul 2012 23:47:53 +0200 References: <1341175915-26856-1-git-send-email-siwu@hrz.tu-chemnitz.de> In-Reply-To: <1341175915-26856-1-git-send-email-siwu@hrz.tu-chemnitz.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201207052347.54053.lindner_marek@yahoo.de> Subject: Re: [B.A.T.M.A.N.] [PATCH] batman-adv: check batadv_orig_hash_add_if() return code Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: The list for a Better Approach To Mobile Ad-hoc Networking On Sunday, July 01, 2012 22:51:55 Simon Wunderlich wrote: > If this call fails, some of the orig_nodes spaces may have been > resized for the increased number of interface, and some may not. > If we would just continue with the larger number of interfaces, > this would lead to access to not allocated memory later. > > We better check the return code, and don't add the interface if > no memory is available. OTOH, keeping some of the orig_nodes > with too much memory allocated should hurt no one (except for > a few too many bytes allocated). > > Signed-off-by: Simon Wunderlich > --- > hard-interface.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) Applied in revision c4499bb. Thanks, Marek