From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 5C5D36DE0BA2 for ; Fri, 16 Jun 2017 15:50:35 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.12 X-Spam-Level: X-Spam-Status: No, score=-0.12 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JqEOE09gjIIS for ; Fri, 16 Jun 2017 15:50:34 -0700 (PDT) Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by arlo.cworth.org (Postfix) with ESMTPS id 29C0D6DE0927 for ; Fri, 16 Jun 2017 15:50:34 -0700 (PDT) Received: by mail-wm0-f49.google.com with SMTP id m125so37042461wmm.1 for ; Fri, 16 Jun 2017 15:50:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+cVd9qkCErkRKl3c5LlGBpndxYhbxhpDYXyJvQ7fMro=; b=T/PW73NGhm/WljPHoZHc8Dr0kiktk2GlfQ0Xhh/cloEkqiioLv3FicF2pclCmwMuGl aVVkwaTBPn+aHoz75lRdrOgWnO33M36TIhIxm7bukO6AkHvHKdwgnPtzx4XV+lQWyeSv 5lSeJxOVgG65DfJPeuTyojVkzdi7PkbZ3+mW8kTryZFhA5hSleywRbZPXvyfmtr41N6G l5+i3VTuaI2uQ1Obfj5g44AYtH8lUyiHUcdfwHn9r2m9UKPAzMDozxSEnERT0fgiM39E exAFYr8M0wCx/OtmIIB+cxQ0FNB3sf7vYLIyLaAhptN8KCF7siqmgsYfnuHjdPeimdpo vRlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+cVd9qkCErkRKl3c5LlGBpndxYhbxhpDYXyJvQ7fMro=; b=k1St3jeKIsxbTFI0bpvJLgbnekryXvkOeCuugkLnBhDD+VDQABon6MootuGa4+RSUW U3DYrNJm0jbx8kZtOhArM+bjqhPiKRtJENc8A2Vn2YmLnzd+fXvYTr5j256OOjmb8QFc DroYXTt0rFt8QHCg2dFEPx20Y+phoG6ODw5yWh/BQSCUiQSRbnmmiHsynrvk46CRUE6A a2KxvuU60rNafVu98o1/Q8Kl34E3VeEwH1mSWEedLs7UbdITCdIh5r6ufQp9QMXcfb+e HpuBF/nVqEgXIPQktNzQ0GMJT1gljrbsqfjHt0f1v76GTtl4ipb9Eg2tn/vl56lA5Q3b j8zA== X-Gm-Message-State: AKS2vOypvqy73Z78/keBZ9siecnI/u+D/fgPLukvtzybgjHWitqCZgi3 oNRtT6V5Qm0LrmR8 X-Received: by 10.28.103.70 with SMTP id b67mr4359282wmc.11.1497653432277; Fri, 16 Jun 2017 15:50:32 -0700 (PDT) Received: from sparkmobile.lan (209.166.93.209.dyn.plus.net. [209.93.166.209]) by smtp.gmail.com with ESMTPSA id y17sm4441851wrb.39.2017.06.16.15.50.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Jun 2017 15:50:31 -0700 (PDT) From: Piotr Trojanek To: notmuch@notmuchmail.org Subject: [PATCH 2/5] add leaks due to missing invocations of va_end Date: Fri, 16 Jun 2017 23:50:23 +0100 Message-Id: <20170616225026.8098-2-piotr.trojanek@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170616225026.8098-1-piotr.trojanek@gmail.com> References: <20170616225026.8098-1-piotr.trojanek@gmail.com> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jun 2017 22:50:35 -0000 As the Linux man page states: "Each invocation of va_start() must be matched by a corresponding invocation of va_end() in the same function." Detected by cppcheck. --- tag-util.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git tag-util.c tag-util.c index 7091d294..30c2c077 100644 --- tag-util.c +++ tag-util.c @@ -28,6 +28,9 @@ line_error (tag_parse_status_t status, fprintf (stderr, status < 0 ? "Error: " : "Warning: "); vfprintf (stderr, format, va_args); fprintf (stderr, " [%s]\n", line); + + va_end (va_args); + return status; } @@ -200,6 +203,8 @@ message_error (notmuch_message_t *message, vfprintf (stderr, format, va_args); fprintf (stderr, "Message-ID: %s\n", notmuch_message_get_message_id (message)); fprintf (stderr, "Status: %s\n", notmuch_status_to_string (status)); + + va_end (va_args); } static int -- 2.11.0