From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id CEC0C469719 for ; Fri, 28 Feb 2020 10:40:16 +0300 (MSK) Received: by mail-lj1-f194.google.com with SMTP id 143so2223040ljj.7 for ; Thu, 27 Feb 2020 23:40:16 -0800 (PST) From: Cyrill Gorcunov Date: Fri, 28 Feb 2020 10:40:09 +0300 Message-Id: <20200228074009.32669-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH] test: unit/popen -- fix potential uninitialized access List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml If handle allocation failed we may access unitialized variable. Not a big deal in this particular case but better to be on safe side and make compilers happy. Signed-off-by: Cyrill Gorcunov --- Otherwise some compiers complain and master branch doesn't pass testing. test/unit/popen.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/popen.c b/test/unit/popen.c index f364cee14..03c3d952f 100644 --- a/test/unit/popen.c +++ b/test/unit/popen.c @@ -53,7 +53,7 @@ popen_write_exit(void) POPEN_FLAG_FD_STDERR | TEST_POPEN_COMMON_FLAGS, }; - int rc; + int rc = -1; plan(7); header(); @@ -123,7 +123,7 @@ popen_read_exit(void) POPEN_FLAG_FD_STDERR | TEST_POPEN_COMMON_FLAGS, }; - int rc; + int rc = -1; plan(5); header(); @@ -181,7 +181,7 @@ popen_kill(void) POPEN_FLAG_FD_STDERR | TEST_POPEN_COMMON_FLAGS, }; - int rc; + int rc = -1; plan(4); header(); -- 2.20.1