From patchwork Mon Apr 13 10:46:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 3432 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 4055A62826 for ; Mon, 13 Apr 2020 12:46:55 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=uajain.com header.i=@uajain.com header.b="sOylzT+u"; 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=lN5t0qg8HDzYt647wu399qU8mdOYbLlm40/6lHf9K4M=; b=sOylzT+uQ8DzJXoOXDewWwkkLEbDRQmHP6dxwlVYC6Ib61sPq04JRyQZWdz7RoI7h47D FpXYCkMdpFiMRWzhsLnW8tTShIKdhPnY//TiRRtKST9CitFl28BxjOQrt6SIDXxFwt6vHF j7hmxtDsZJdAz4sZ0GHRJ1oQ5QSUnp7Bs= Received: by filterdrecv-p3iad2-8ddf98858-xn4j7 with SMTP id filterdrecv-p3iad2-8ddf98858-xn4j7-19-5E94431D-4E 2020-04-13 10:46:53.970656372 +0000 UTC m=+1589960.232487496 Received: from mail.uajain.com (unknown) by ismtpd0003p1maa1.sendgrid.net (SG) with ESMTP id pBCBNRobS1WWPUlJ5XCRAQ Mon, 13 Apr 2020 10:46:53.546 +0000 (UTC) From: Umang Jain Date: Mon, 13 Apr 2020 10:46:53 +0000 (UTC) Message-Id: <20200413104631.12276-4-email@uajain.com> In-Reply-To: <20200413104631.12276-1-email@uajain.com> References: <20200413104631.12276-1-email@uajain.com> Mime-Version: 1.0 X-SG-EID: 1Q40EQ7YGir8a9gjSIAdTjhngY657NMk9ckeo4dbHZDiOpywc/L3L9rFqlwE4KPc/mSirh79xX0l6HRHZb2eYA0RzoWaZc/nZ9Udko5MldTi0ZsdsFe5G+ye+/UjefY0wCezfshHodjSd9PWgoKnbrFFFjQtb8Bm8oTEbA1lVfl04A9DeEThI8P04m+SDVdK9RH1x+gGuI+HjwSAO3CUOV6+y4pMN1TEls+C7pevfKRutLTuMGuO1D5zWsJcn9j/dYQztw8mVrqMyoqdNJ1DTA== To: libcamera-devel@lists.libcamera.org Subject: [libcamera-devel] [PATCH 3/4] test: log: log_api: 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: Mon, 13 Apr 2020 10:46:55 -0000 Pointed out by Coverity DefectId=279091 Signed-off-by: Umang Jain --- test/log/log_api.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/test/log/log_api.cpp b/test/log/log_api.cpp index 33622f8..aeedbf9 100644 --- a/test/log/log_api.cpp +++ b/test/log/log_api.cpp @@ -96,6 +96,7 @@ protected: lseek(fd, 0, SEEK_SET); if (read(fd, buf, sizeof(buf)) < 0) { cerr << "Failed to read tmp log file" << endl; + close(fd); return TestFail; } close(fd);