From patchwork Fri Feb 11 16:04:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bogdan Lezhepekov X-Patchwork-Id: 1591714 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=0KW2XexP; dkim=fail reason="signature verification failed" header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=5FIQN1QO; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JwJNJ41xBz9sFq for ; Sat, 12 Feb 2022 03:04:48 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 6717B3C9F04 for ; Fri, 11 Feb 2022 17:04:46 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [217.194.8.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 1B2633C2690 for ; Fri, 11 Feb 2022 17:04:43 +0100 (CET) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-6.smtp.seeweb.it (Postfix) with ESMTPS id 6D51214013BE for ; Fri, 11 Feb 2022 17:04:43 +0100 (CET) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id AE3E11F3A8; Fri, 11 Feb 2022 16:04:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1644595482; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=qJVUnr6tqDHm0Xzhl6dbqJ14X+LwLa21URIRNmo+EAY=; b=0KW2XexPVGjAvCY/NIDiwsaYnrK0IofGoOtnSx3BMNJhSWiEYxU+O7CP2bWPtR0kCWojB/ XNYVPEpxLUQZL3OZmZBIkL6JAdaGDAxGqTeHqeGOgdlKLrCLcZX+uu8LhukUh4ojXV+Btq qfHX/mWjz/E5RrVY5CZViu6WGbqM8P4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1644595482; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=qJVUnr6tqDHm0Xzhl6dbqJ14X+LwLa21URIRNmo+EAY=; b=5FIQN1QO97AzzX+j+gnxBFeZ9TzGQhVZedOvpR9iW/V7dix/LaJ7iy608ORLLfYFW/KHh8 1ys4a9sLs9awU0AQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 653E413C9A; Fri, 11 Feb 2022 16:04:42 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 9s2wFRqJBmINYQAAMHmgww (envelope-from ); Fri, 11 Feb 2022 16:04:42 +0000 From: Bogdan Lezhepekov To: ltp@lists.linux.it Date: Fri, 11 Feb 2022 18:04:40 +0200 Message-Id: <20220211160440.9342-1-blezhepekov@suse.de> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-6.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-6.smtp.seeweb.it Subject: [LTP] [PATCH v2] lib/tst_memutils.c: Fix resource leak X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: martin.doucha@suse.com Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" File descriptor was not closed properly before return. Signed-off-by: Bogdan Lezhepekov --- lib/tst_memutils.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/tst_memutils.c b/lib/tst_memutils.c index 4a4974761..2e6d7d5fd 100644 --- a/lib/tst_memutils.c +++ b/lib/tst_memutils.c @@ -122,7 +122,10 @@ static int write_score(const char *path, int score) return 1; if (fprintf(f, "%d", score) <= 0) + { + fclose(f); return 1; + } if (fclose(f)) return 1;