From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) by sourceware.org (Postfix) with ESMTPS id 815E63847805 for ; Thu, 17 Jun 2021 18:07:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 815E63847805 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rtems.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f180.google.com with SMTP id l4so10363153ljg.0 for ; Thu, 17 Jun 2021 11:07:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:from:date:message-id :subject:to; bh=Yw8SPbJxYB61YU3JrwiisLnvbb2ZIsyF7T1ERiuuTvU=; b=XTq6njXFEOd8UFspRC5D5F3JxfjVKOyFnyTxvxbqP/5rd4xFW1+NIl/vkV/5Mf1ZlL RsApKPbgf/fkrn2qshGC1nbYhhAkJwyRTEk/EIU7tzWdmjm20hB2dzWb6onpvrxITQSf n9e9eDw+kgNyoown2RoLc1m+Lz+NpPbvH3kANvcmI1p4aOmbB75OnWHQtRL7fyDsyXEg AuYC4edrVZdC611g2klVOc8NMqK7RddMwLSOYTq3aPZnggqfV42NffesTYH+Az1OcGKx CS7608ZQMtut+rG+n+boavmEthQLeH/mad3nfdRfBEoLQ504nus36ILkNhr2LbkECM12 paxg== X-Gm-Message-State: AOAM532ZBvuNGvdGV6+BXbY9nRzrEGp1qrcgCO7/+m9gxzVpC14g/PiL B8ffDYDnNCjw2KqIhAG6OBSW2fFihWAL6g== X-Google-Smtp-Source: ABdhPJwjBbEUMKYDsF1yplDTLVqQ53cgqMDCmPHWOXUHyVkOFcWzxPiLf8JPvB7brNfJ3YedvdLwlw== X-Received: by 2002:a2e:9b8c:: with SMTP id z12mr5803937lji.11.1623953230058; Thu, 17 Jun 2021 11:07:10 -0700 (PDT) Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com. [209.85.208.171]) by smtp.gmail.com with ESMTPSA id m19sm648417lfl.75.2021.06.17.11.07.09 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Jun 2021 11:07:09 -0700 (PDT) Received: by mail-lj1-f171.google.com with SMTP id d2so10248367ljj.11 for ; Thu, 17 Jun 2021 11:07:09 -0700 (PDT) X-Received: by 2002:a2e:6819:: with SMTP id c25mr5907339lja.140.1623953229424; Thu, 17 Jun 2021 11:07:09 -0700 (PDT) MIME-Version: 1.0 Reply-To: joel@rtems.org From: Joel Sherrill Date: Thu, 17 Jun 2021 13:06:58 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: makedoc.c: Coverity Scan Issues To: Newlib X-Spam-Status: No, score=-3031.9 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2021 18:07:13 -0000 Hi Scan reports 3 issues in makedoc.c. One is a memory leak around lines 1202 to 1282 because the variable word holds memory allocated inside nextword. The method returns without freeing the memory. I think adding a free() is sufficient for this. The others are from calling realloc() and not checking for NULL around line 137. Is checking for the NULL, printing a message, and exit(1), an OK thing to do here? Thanks. --joel