From patchwork Fri May 15 12:42:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 3798 Return-Path: Received: from o1.f.az.sendgrid.net (o1.f.az.sendgrid.net [208.117.55.132]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E2BFF60E13 for ; Fri, 15 May 2020 14:42:54 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=uajain.com header.i=@uajain.com header.b="Jks/uQxm"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uajain.com; h=from:subject:in-reply-to:references:mime-version:to:cc: content-transfer-encoding:content-type; s=s1; bh=hidbZmSCedH/UeQG+0jv3X5RNRj/EkzKOHm8deO5gWc=; b=Jks/uQxmQKIOk0RnN+eZ9xa5S9OgjKiw93iZBs6fWn+FeCQEk5pAauMhb5GWz0ARoVc3 EzUXmbYs3nv698XY/TNuq42eBOL64jbazfqxS3A47Kcxzbnn3D0rBI0YKgfgQJSNuvxagr ZqmDjZdjlBiovXtBUECGPUPxzQk53yzy0= Received: by filter0084p3las1.sendgrid.net with SMTP id filter0084p3las1-1974-5EBE8E4C-A1 2020-05-15 12:42:52.854806595 +0000 UTC m=+2558464.992313740 Received: from mail.uajain.com (unknown) by ismtpd0005p1maa1.sendgrid.net (SG) with ESMTP id Bb31tzGJTlujrBoPAJbqoA Fri, 15 May 2020 12:42:52.252 +0000 (UTC) From: Umang Jain Date: Fri, 15 May 2020 12:42:52 +0000 (UTC) Message-Id: <20200515124245.18040-3-email@uajain.com> In-Reply-To: <20200515124245.18040-1-email@uajain.com> References: <20200515124245.18040-1-email@uajain.com> Mime-Version: 1.0 X-SG-EID: 1Q40EQ7YGir8a9gjSIAdTjhngY657NMk9ckeo4dbHZDiOpywc/L3L9rFqlwE4KPcofpXQ1KwJPJayd5tGsU1eE0zU8daDke3ehhqRL/kdCxt6mtbjh37tkVljdm4f4vWvqsgOrdrY9upOA2muDKs5nB+vNHsfvcyHnyHhIbiFJB11jE/WP5UHPJvn909pI48egvoXqHN56y3rAB7G7LaR2sy4Pim5FJ434utqowL7SLsouqkjOSppkW4RsgBetSW To: libcamera-devel Subject: [libcamera-devel] [PATCH v2 2/4] test: log: log_process: Close open fds on error paths X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 12:42:55 -0000 Pointed out by Coverity DefectId=279097 Signed-off-by: Umang Jain Reviewed-by: Kieran Bingham --- test/log/log_process.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/test/log/log_process.cpp b/test/log/log_process.cpp index 2df4aa4..88baa27 100644 --- a/test/log/log_process.cpp +++ b/test/log/log_process.cpp @@ -106,6 +106,7 @@ protected: memset(buf, 0, sizeof(buf)); if (read(fd, buf, sizeof(buf)) < 0) { cerr << "Failed to read tmp log file" << endl; + close(fd); return TestFail; } close(fd);