Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 55A2ACDB47E for ; Fri, 13 Oct 2023 15:18:24 +0000 (UTC) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id C8A943CF613 for ; Fri, 13 Oct 2023 17:18:21 +0200 (CEST) Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [IPv6:2001:4b78:1:20::4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id A47DC3CD3E5 for ; Fri, 13 Oct 2023 17:17:27 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) (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-4.smtp.seeweb.it (Postfix) with ESMTPS id 81E7F1000D3B for ; Fri, 13 Oct 2023 17:17:27 +0200 (CEST) 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-out1.suse.de (Postfix) with ESMTPS id E5B3521A02 for ; Fri, 13 Oct 2023 15:17:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1697210245; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HgkGr2/fUx7cuRwk1GhpZjZrzDZ3NHJsKEPRHsvS3bI=; b=vgc5by6QlAD+pAqG89yT+xezN2ITO+Ck/uBCZaYL5xHmDMqIpexVlD2THrnVeJGtER0Oke TKku7U4+tD1pe5Qix/6DEAMAZHinax9Gnqc6SzLtWeBZ3mrQjjF8LnnmnYBPGOMGTC6fNB 41xCWlcQdo33yO7RAdUvEtnzCI7/mjo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1697210245; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HgkGr2/fUx7cuRwk1GhpZjZrzDZ3NHJsKEPRHsvS3bI=; b=jQVLC5Jg/7A8BjZsE5XgJcq5/m+aAi74sxczoZV0k11xnivVwfQBFRGwmuk7H2VMH2jsHd DzOKCWTARbpjSKDw== 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 CD1E2138EF for ; Fri, 13 Oct 2023 15:17:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 6KNgMYVfKWU3SQAAMHmgww (envelope-from ) for ; Fri, 13 Oct 2023 15:17:25 +0000 From: Martin Doucha To: ltp@lists.linux.it Date: Fri, 13 Oct 2023 17:17:15 +0200 Message-ID: <20231013151724.23057-3-mdoucha@suse.cz> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231013151724.23057-1-mdoucha@suse.cz> References: <20231013151724.23057-1-mdoucha@suse.cz> MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; none X-Spamd-Result: default: False [0.90 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[ltp@lists.linux.it]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-3.00)[-1.000]; TO_DN_NONE(0.00)[]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-Virus-Scanned: clamav-milter 1.0.1 at in-4.smtp.seeweb.it X-Virus-Status: Clean Subject: [LTP] [PATCH 2/3] tst_netlink_destroy_context(): Allow safely passing NULL context 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-bounces+ltp=archiver.kernel.org@lists.linux.it Sender: "ltp" Signed-off-by: Martin Doucha --- lib/tst_rtnetlink.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/tst_rtnetlink.c b/lib/tst_rtnetlink.c index eacfdced1..bf782ffb5 100644 --- a/lib/tst_rtnetlink.c +++ b/lib/tst_rtnetlink.c @@ -55,6 +55,9 @@ static int netlink_grow_buffer(const char *file, const int lineno, void tst_netlink_destroy_context(const char *file, const int lineno, struct tst_netlink_context *ctx) { + if (!ctx) + return; + safe_close(file, lineno, NULL, ctx->socket); free(ctx->buffer); free(ctx); -- 2.42.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp